const person = {};
person.name.toUpperCase();
console.log(person.name);
Please open Telegram to view this post
VIEW IN TELEGRAM
π6 6β€4
I felt old when Ania said βif youβve never played Pac-Man before..β π β nonetheless, sheβs back with another of her fantastic, thorough walkthroughs.
ANIA KUBΓW
Please open Telegram to view this post
VIEW IN TELEGRAM
π17 11β€5π€©3
function fetchData(url) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (url.startsWith('https://api.example.com')) {
resolve({ data: 'Some data' });
} else {
reject(new Error('Invalid URL'));
}
}, 1000);
});
}
fetchData('https://api.example.com/data')
.then(response => console.log(response.data))
.catch(error => console.error(error));
Please open Telegram to view this post
VIEW IN TELEGRAM
β€11π11π€3 3
What is the output?
Anonymous Quiz
64%
Some data
18%
ReferenceError: resolve is not defined at line 4
10%
SyntaxError: Unexpected token '{' at line 2
8%
Error: Invalid URL at line 8
Please open Telegram to view this post
VIEW IN TELEGRAM
π60β€16 13π€7π€©3π€£3
class Rectangle {
constructor(width, height) {
this.width = width;
this.height = height;
}
get area() {
return this.width * this.height;
}
}
const rectangle = new Rectangle(5, 10);
console.log(rectangle.area());
Please open Telegram to view this post
VIEW IN TELEGRAM
π14π€£2
What is the output?
Anonymous Quiz
41%
TypeError: rectangle.area is not a function at line 13
12%
ReferenceError: height is not defined at line 3
11%
Error: Cannot access 'this' before initialization at line 5
36%
No error
π25 8π€7β€3
Learn more about why and where SQL injection attacks pose a threat and some initial ways to shield your Node apps against them.
LUCIEN CHEMALY
Please open Telegram to view this post
VIEW IN TELEGRAM
π13β€4 4
const obj = { a: 1, b: 2 };
const key = 'c';
console.log(obj[key]);
Please open Telegram to view this post
VIEW IN TELEGRAM
π16β€4 3
What is the output?
Anonymous Quiz
27%
ReferenceError: c is not defined at line 3
52%
undefined
15%
TypeError: obj is not iterable at line 3
6%
No error
The Deno team is cooking up JSR (still behind a waitlist), a new JavaScript package registry (not merely a package management tool, like pnpm or Yarn) to address various npm limitations, including for Node users who don't even plan to use Deno.
SARAH GOODING
Please open Telegram to view this post
VIEW IN TELEGRAM
const promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Resolved');
reject(new Error('Rejected'));
}, 1000);
});
promise.then(response => console.log(response)).catch(error => console.error(error));
Please open Telegram to view this post
VIEW IN TELEGRAM
π11β€5
What is the output?
Anonymous Quiz
20%
Error: Rejected at line 8
54%
Resolved
18%
ReferenceError: response is not defined at line 7
9%
SyntaxError: Unexpected token 'catch' at line 9
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£93 7β€4π3π€©2π€1
CHALLENGE β
function asyncQuiz() {
return new Promise((resolve) => {
setTimeout(() => resolve('Hello'), 1000);
});
}
async function runAsyncQuiz() {
const result = await asyncQuiz();
console.log(result);
}
runAsyncQuiz();
console.log('World');Please open Telegram to view this post
VIEW IN TELEGRAM
π11
β€22 12π€9
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£99 12π5π€3π€©3
var a = 1;
function scopeQuiz() {
console.log(a);
var a = 2;
}
scopeQuiz();
Please open Telegram to view this post
VIEW IN TELEGRAM
π€23π13β€7 2
π€34 8π6β€4π€©1
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£98π13 9π€5β€1π€©1