Telegram Web
πŸ“Œ Question: What will be the output of the code snippet above?
Anonymous Poll
63%
A) 20
16%
B) null
14%
C) undefined
7%
D) Error
βœ… Challenge.
let obj1 = {
  name: 'Alice',
  getName: function() {
    return this.name;
  }
};


let obj2 = {
  name: 'Bob'
};

let getNameFunc = obj1.getName.bind(obj2);

console.log(getNameFunc());
πŸ“ŒQuestion: what will be the output of the code snippet above?
Anonymous Quiz
26%
A) Alice
45%
B) Bob
18%
C) undefined
11%
D) Error
βœ… Title: Node.js Documentary.

Content : Are you fascinated by the world of Node.js? Dive deep into its history, development, and impact with this insightful documentary. Explore how Node.js has revolutionized web development and learn about its key features and advantages. Watch now to uncover the secrets behind one of the most popular runtime environments.

πŸ“Œ Link: https://bit.ly/3PHluS0

.
βœ… 10 must have GitHub repos for web developers:

1. Free for dev - Click here
2. Tech Interview Handbook
- Click here
3. Javascript Algorithms and Data-structure - Click here
4. You don't know JS - Click here
5. Node.js Best Practices - Click here
6. HTML5 Boilerplate - Click here
7. 30 Seconds of Code - Click here
8. Clean Code JavaScript - Click here
9. Awesome Node.js - Click here
10. 33 JS Concepts - Click here
βœ… Debouncing function in Javascript.

Debouncing makes sure that a function doesn't run too often in a short period of time.

// 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);
βœ… Challenge.(Promise)

const promise = new Promise((resolve, reject) => {
resolve('Success');
});

promise.then(result => {
console.log(result) // ?
});

console.log('End'); // ?
πŸ“ŒQuestion: what will be the output of the code snippet above?
Anonymous Quiz
38%
A) "Success", "End"
37%
B) "End", "Success"
14%
C) "Success"
11%
D) "End"
βœ… Challenge. (Map)
// 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);
πŸ“Œ Question: what will be the output of the code snippet above?
Anonymous Quiz
53%
A). ['a', 'b', 'a']
37%
B). ['a', 'b']
6%
C). ['a']
3%
D). ['b']
βœ… Challenge. (Object)
const obj = {
a: 1,
b: {
c: 2
}
};

const newObj = Object.assign({}, obj);
newObj.b.c = 3;

console.log(obj.b.c);
πŸ“Œ Question: what will be the output of the code snippet above?
Anonymous Quiz
8%
A). 1
33%
B). 2
44%
C). 3
16%
D). undefined
βœ… Challenge. (Map)
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));
πŸ“Œ Question: what will be the output of the code snippet above?
Anonymous Quiz
24%
A). object, undefined
48%
B). object, array
15%
C). undefined, array
14%
D). undefined, undefined
βœ… Challenge. (Symbol)

const sym1 = Symbol('foo');
const sym2 = Symbol('foo');

console.log(sym1 === sym2);
πŸ“Œ Question: what will be the output of code snippet above?
Anonymous Quiz
55%
A). true
29%
B). false
13%
C). undefined
4%
D). null
βœ… Challenge. (Object)

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);
πŸ“Œ Question: what will be the output of the code snippet above?
Anonymous Quiz
35%
A) ['JavaScript', 'Node.js']
48%
B) ['JavaScript', 'Node.js', 'React']
10%
C) ['React']
8%
D) Error
βœ… Challenge. (Map)
// 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);
πŸ“Œ Question: what will be the output of the code snippet above?
Anonymous Quiz
61%
A). ['a', 'b', 'a']
31%
B). ['a', 'b']
5%
C). ['a']
2%
D). ['b']
2025/01/28 02:53:31
Back to Top
HTML Embed Code: