Find the missing character and their index – JS
The missing letter is ‘c’, and its index is 2.
Empowering the Coding Wave
The missing letter is ‘c’, and its index is 2.
JWT stands for JSON Web Token.Typically used for authentication and authorization purposes.A JWT is essentially a self-contained token that contains information in the form of JSON data, which is digitally…
localStorage and sessionStorage are both web storage options provided by modern web browsers to store data on the client side (in the user’s browser) without relying on cookies. They are…
call, apply, and bind are three methods available in JavaScript that are used to manipulate the this value and call functions in different ways. They are often used to control…
var a= ‘amit’;var b=a; function abc(){console.log(‘in a1 :’,a)var a = ‘Mohit’;console.log(‘in a2 :’,a)}b =’sumit’abc(a);console.log(‘a’,a)console.log(‘b’,b) Output: It looks like you’ve provided a JavaScript code snippet. Let’s break down what’s happening step…
//check a string has substring or notconst str = ‘Har har Modi,Ghar-Ghar Modi.’;const sub_str = ‘Modi’;console.log(‘Is string has a substring? ‘,str.includes(sub_str))// this is case senstive //Get first index of a…
//Get Sum of Fruites from Array Element const fruites = [{‘apple’:4,’mango’:7,’banana’:10},{‘apple’:7,’mango’:2,’banana’:11},{‘apple’:1,’mango’:6,’banana’:14},];let cnt = [];fruites.forEach((v)=>{for(key in v){cnt[key]= (cnt[key]+v[key]) || v[key];}})console.log(‘v’,cnt)
In JavaScript, map, filter, and reduce are array functions used to perform transformations on arrays. Each of these functions serves a different purpose: Syntax: Example: Syntax: Example: Syntax: Example: In…