const x = [1, 2, 3];
const y = x;
y.push(4);
console.log(x);
Please open Telegram to view this post
VIEW IN TELEGRAM
What is the output?
Anonymous Quiz
61%
[1, 2, 3, 4]
24%
[1, 2, 3]
9%
[1, 2, 3] [1, 2, 3, 4]
6%
TypeError: console.log is not a function
π25π€13π€£7 6β€2
JSR is a new package repository being introduced by the team at Deno that aims to solve many problems in the Javascript eco-system. I was invited to take part in very early access to it and want to share my impressions.
Kitson P. Kelly
Please open Telegram to view this post
VIEW IN TELEGRAM
let i = 0;
for (; i < 5; i++) {
setTimeout(() => console.log(i), 0);
}
Please open Telegram to view this post
VIEW IN TELEGRAM
β€9π7
π€57π14π€©7 2
Work on React Compiler has progressed with it now powering Instagramβs prod site ('React 19 Will Be Compiled' goes into depth on what the compiler means for most React devs). We also learn React 19 is on the way and will include breaking changes to support things like Web Components.
THE REACT.JS CORE TEAM
Please open Telegram to view this post
VIEW IN TELEGRAM
const num = 8;
const obj = {
num: 10,
inner: {
num: 6,
getNum: function() {
return this.num;
}
}
};
console.log(obj.inner.getNum());
const getNum = obj.inner.getNum;
console.log(getNum());
Please open Telegram to view this post
VIEW IN TELEGRAM
Rafael, of the Node.js TSC and Fastify core team, shares a useful update on the evolution of Node.js over the past year, how the team ensures Node is well tested and reliable, changes to Nodeβs vendor dependencies (of which it gained three in 2023), as well as enhancements to Nodeβs security and Web presence.
RAFAEL GONZAGA
Please open Telegram to view this post
VIEW IN TELEGRAM
π6β€3π€2 2
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