TGViewer
Channel Public Channel
JavaScript

JavaScript

@javascript

A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!

Let's chat: @nairihar
Subscribers
31.1K
Photos
1.2K
Videos
10
Links
895

Showing posts older than #2881 · Back to latest

Older Posts 20 shown
Post #2880 4.1K
✌️ The JavaScript Bundler Grand Prix

Bundlers now sit at the heart of many JavaScript workflows and are sometimes even integrated into runtimes (e.g. Bun’s). This piece surveys the landscape and argues the speed wars are mostly over, with the real battle shifting to artifact size and the code that actually ships to users.

Kate Holterhoff
  • 👍 5
  • ❤ 4
  • 🔥 1
Post #2879 3.83K
  • 👍 7
  • 🤔 2
Post #2878 4.06K
CHALLENGE

const getValue = (x) => {
console.log(`Getting: ${x}`);
return x;
};

const obj = { name: null };

const result = obj.name || getValue('default') && getValue('final');
console.log(`Result: ${result}`);
  • 👍 5
  • 🔥 2
Post #2876 4.25K
  • 👍 4
  • ❤ 2
  • 🔥 2
  • 🤣 2
  • 🤔 1
Post #2875 4.19K
CHALLENGE

const numbers = [1, 2, 3, 4, 5];
const result = numbers
.filter(n => n % 2 === 0)
.map(n => n * 2)
.reduce((acc, curr) => acc + curr, 0);

const original = numbers.slice();
numbers.splice(2, 1, 99);

console.log(result);
console.log(numbers);
console.log(original);
  • ❤ 4
  • 🔥 2
  • 👍 1
  • 🤣 1
Post #2874 4.56K
Merry Christmas 🎄
  • ❤ 59
  • 👍 14
  • 🔥 5
  • 🤔 2
  • 🤩 1
Post #2873 4.97K
  • 👍 5
  • ❤ 3
  • 🤔 3
  • 🔥 2
Post #2872 4.67K
CHALLENGE

const obj = Object.seal({ a: 1, b: { c: 2 } });
obj.a = 10;
obj.b.c = 20;
obj.d = 30;
delete obj.a;

const frozen = Object.freeze({ x: 5, y: { z: 10 } });
frozen.x = 50;
frozen.y.z = 100;
delete frozen.y;

console.log(obj.a, obj.b.c, obj.d, frozen.x, frozen.y.z);
  • ❤ 7
  • 👍 2
Post #2871 4.34K
  • 👍 7
  • 🤔 3
  • 🤩 2
  • ❤ 1
Post #2870 4.22K
CHALLENGE

const x = 5;
const y = 10;

const result = `${x + y}`;
const nested = `Value: ${`${x}` + `${y}`}`;
const expr = `${x}${y}`;

console.log(result);
console.log(nested);
console.log(expr);
console.log(typeof result);
  • ❤ 2
  • 👍 1
  • 🔥 1
Post #2869 4.11K
  • ❤ 6
  • 🤔 2
Post #2868 4.04K
CHALLENGE

const x = 0.1 + 0.2;
const y = 0.3;

console.log(x === y);
console.log(x.toFixed(1) === y.toFixed(1));
console.log(+x.toFixed(1) === +y.toFixed(1));

const num = 42;
console.log(num.toString(2));
console.log(parseInt('101010', 2));
  • ❤ 2
  • 👍 2
  • 🔥 2
Post #2866 4.15K
💎 Sponsored

Gold quietly hit a new record in 2025 🚀

Some assets move fast, others move steadily, but both say something about how we react to risk.

How well do you read these shifts?

Check yourself by taking a short quiz.
  • 🤣 6
  • 🤔 5
Post #2865 3.38K
  • ❤ 7
  • 👍 4
Post #2864 3.71K
CHALLENGE

const multiplier = 3;

function createCounter() {
let count = 0;
const multiplier = 5;

return function() {
count++;
return count * multiplier;
};
}

const counter = createCounter();
console.log(counter());
console.log(counter());
console.log(multiplier);
  • ❤ 8
  • 👍 1
  • 🔥 1
Post #2863 3.69K
  • 🤔 6
  • ❤ 5
  • 🔥 2
  • 👍 1
Post #2862 3.92K
CHALLENGE

const json = '{"name":"Sarah","age":25,"active":true}';
const obj = JSON.parse(json);

obj.name = "Emma";
obj.age++;

const json2 = JSON.stringify(obj);
const obj2 = JSON.parse(json2);

obj.age = 100;

console.log(obj2.age);
  • ❤ 2
Post #2861 4.33K
  • 👍 3
  • ❤ 1
  • 🔥 1
Post #2860 3.96K
CHALLENGE

function Vehicle(type) {
this.type = type;
this.wheels = 4;
}

Vehicle.prototype.describe = function() {
return `${this.type} with ${this.wheels} wheels`;
};

const car = new Vehicle('Car');
const bike = Vehicle('Bike');

console.log(car.describe());
console.log(typeof bike);
console.log(globalThis.type);
  • 👍 1
Older posts →
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →