✅ Topic : What is Map in JavaScript ?
"new Map()" - is a built-in object in JavaScript that represents a collection of key-value pairs. It was introduced in ECMAScript 6 and is similar to an object, but with some important differences.
One of the main differences between a Map object and a regular JavaScript object is that the keys in a Map object can be any type of value, including objects and functions, while the keys in an object must be strings or symbols.
(👥) • @Web_developersz
(📚) • @Web_developerszz
#Map #JavaScript
"new Map()" - is a built-in object in JavaScript that represents a collection of key-value pairs. It was introduced in ECMAScript 6 and is similar to an object, but with some important differences.
One of the main differences between a Map object and a regular JavaScript object is that the keys in a Map object can be any type of value, including objects and functions, while the keys in an object must be strings or symbols.
(👥) • @Web_developersz
(📚) • @Web_developerszz
#Map #JavaScript
✅ Javascript Reduce method Example.
▫️ Finding the longest word in a given string.
#JavaScript #Reduce
(👥) • @Web_developersz
(📚) • @Web_developerszz
▫️ Finding the longest word in a given string.
function longerWord(a, b) {
if (a.length > b.length) {
return a;
} else {
return b;
}
}
const sentence = 'Hey there what are you doing this Wednesday night';
const longest = sentence.split(' ').reduce(longerWord);
console.log(longest);
// Wednesday
#JavaScript #Reduce
(👥) • @Web_developersz
(📚) • @Web_developerszz
✅ Quiz Time - Immediately Invoked Function Expression.
💬 Comment your answer!!!
#JavaScript #IIFE #Quiz
(👥) • @Web_developersz
(📚) • @Web_developerszz
💬 Comment your answer!!!
#JavaScript #IIFE #Quiz
(👥) • @Web_developersz
(📚) • @Web_developerszz