javascript

how many types of functions in javascript?

JavaScript supports several types of functions. Here are some commonly used function types in JavaScript: Named Function: A function with a specified name that can be called using its name. For example: function add(a, b) { return a + b; } Anonymous Function: A function without a name, often assigned …

Read More »

Here are some common interview questions and answers related to microservices:

Q1: What are microservices? A1: Microservices are a software architecture pattern where an application is built as a collection of small, loosely coupled, and independently deployable services. Each service is responsible for a specific business capability and can be developed, deployed, and scaled independently. Q2: What are the benefits of …

Read More »

Top Javascript Interview Questions and answer

1.) What is JavaScript? JavaScript is a high-level, interpreted programming language primarily used for building interactive web pages and web applications. It provides dynamic functionality, enables client-side and server-side scripting, and can be used alongside HTML and CSS to create dynamic web content. 2.) What are the different data types …

Read More »

How to swap two numbers without using a temporary variable?

Swap Two Numbers

Solution – 1 – Using Arithmetic Operators function swapNumb(a, b){ console.log('Before swap Output: ','a: ', a, 'b: ', b); b = b -a; a = a+ b; b = a-b; console.log('After swap Output: ','a: ', a, 'b: ', b); } swapNumb(2, 3); Solution – 2 – Using Bitwise XOR function …

Read More »

How to Create and get nth Fibonacci series number?

Fibonacci series

What is the Fibonacci series? Fibonacci series is the series of numbers that are calculated by adding the values of the previous two numbers in the sequence. The first two numbers of the sequence are zero and one. It is also known as the golden ratio. We can represent the …

Read More »

Simple JavaScript code in promises.

function promiseExample(){ const promise = new Promise((resolve, reject) =>{ resolve('successfully!'); }) .then((resolve) => console.log(resolve)) .catch((reject) => console.log(reject)); return promise; } promiseExample() I have a create simple code example for promises. you can easily check. how to resolve is working? and how to reject is working?

Read More »

You are given a two-digit integer n. Return the sum of its digits.

You are given a two-digit integer n. Return the sum of its digits. Example For n = 29, the output should be solution(n) = 11. Input/Output [execution time limit] 4 seconds (js) [input] integer n A positive two-digit integer. Guaranteed constraints: 10 ≤ n ≤ 99. [output] integer The sum …

Read More »

Given an array of integers a, your task is to count the number of pairs i and j (where 0 ≤ i < j < a.length), such that a[i] and a[j] are digit anagrams.

Given an array of integers a, your task is to count the number of pairs i and j (where 0 ≤ i < j < a.length), such that a[i] and a[j] are digit anagrams. Two integers are considered to be digit anagrams if they contain the same digits. In other …

Read More »

Javascript Bundling in Magento 2

Javascript bundling is a technique that groups separate files in order to reduce the number of HTTP requests that are required to load a page. Bundling is commonly used in today’s “module-based” development where some functionalities are basically split into Modules (roughly explained). For loading modules, we usually use some of popular module loaders such... The post Javascript Bundling in Magento 2 appeared first on Inchoo. Do you need any custome Development Click here and fill the form with full your requirement and after i will send the quotes of your work requirements....

Read More »

More/Less functionality in Magento2

Everything you need to know on how to setup more/less functionality in Magento 2 The post More/Less functionality in Magento2 appeared first on Inchoo. Do you need any custome Development Click here and fill the form with full your requirement and after i will send the quotes of your work requirements....

Read More »