// Create new Map
const map = new Map();
map.set('a', 1);
map.set('b', 2);
map.set('a', 3);
const keys = [];
for (const key of map.keys()) {
keys.push(key);
}
// Output
console.log(keys);
Are you interested in web development and looking to expand your knowledge and skills in this field? Look no further than the 'Web Developer' Telegram channel, also known as '@web_developerszz'. This channel is a one-stop destination for all things related to web development, offering a wide range of resources such as books, YouTube channels, articles, courses, and notes
Whether you are a beginner looking to learn the basics or an experienced developer looking to stay updated with the latest trends and technologies, this channel has something for everyone. From beginner-friendly tutorials to advanced coding techniques, you will find valuable information that will help you enhance your skills and take your web development projects to the next level
One of the key features of this channel is the community aspect. You can join the group @Web_developersz and connect with like-minded individuals who share your passion for web development. Share your ideas, ask questions, and learn from others in a supportive and collaborative environment
Don't miss out on this opportunity to expand your knowledge and network with fellow web developers. Join the 'Web Developer' Telegram channel today and take your web development skills to new heights!
04 Nov, 14:05
// Create new Map
const map = new Map();
map.set('a', 1);
map.set('b', 2);
map.set('a', 3);
const keys = [];
for (const key of map.keys()) {
keys.push(key);
}
// Output
console.log(keys);
25 Aug, 14:32
const employee = {
name: 'Bob',
position: 'Developer',
details: {
skills: ['JavaScript', 'Node.js'],
experience: 5
}
};
const cloneEmployee = JSON.parse(JSON.stringify(employee));
cloneEmployee.details.skills.push('React');
console.log(employee.details.skills);
13 Jul, 15:00
const sym1 = Symbol('foo');
const sym2 = Symbol('foo');
console.log(sym1 === sym2);
09 Jul, 03:02
const map1 = new Map();
const objKey = {};
const arrKey = [];
map1.set(objKey, 'object');
map1.set(arrKey, 'array');
console.log(map1.get(objKey));
console.log(map1.get(arrKey));
08 Jul, 03:01
const obj = {
a: 1,
b: {
c: 2
}
};
const newObj = Object.assign({}, obj);
newObj.b.c = 3;
console.log(obj.b.c);
07 Jul, 03:30
// Create new Map
const map = new Map();
map.set('a', 1);
map.set('b', 2);
map.set('a', 3);
const keys = [];
for (const key of map.keys()) {
keys.push(key);
}
// Output
console.log(keys);
06 Jul, 02:38
const promise = new Promise((resolve, reject) => {
resolve('Success');
});
promise.then(result => {
console.log(result) // ?
});
console.log('End'); // ?
04 Jul, 02:30
// Debouncing util
function debounce(func, wait) {
let timeout;
return function(...args) {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), wait);
};
}
// Usage
const handleResize = debounce(() => {
console.log('Resize event');
}, 300);
window.addEventListener('resize', handleResize);
30 Jun, 06:30
30 Mar, 03:32
01 Mar, 08:31
let obj1 = {
name: 'Alice',
getName: function() {
return this.name;
}
};
let obj2 = {
name: 'Bob'
};
let getNameFunc = obj1.getName.bind(obj2);
console.log(getNameFunc());
25 Feb, 12:15
function outerFunction() {
var outerVar = 20;
function innerFunction() {
return outerVar;
}
return innerFunction;
}
var closureExample = outerFunction();
console.log(closureExample());
12 Jan, 16:44