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
31K
Photos
1.2K
Videos
10
Links
900

Showing posts older than #1791 Β· Back to latest

Older Posts 20 shown
Post #1790 6.03K
  • πŸ”₯ 15
  • πŸ‘ 5
  • ❀ 2
Post #1789 6.34K
CHALLENGE

const obj = {
value: 10,
getValue: function () {
return () => this.value;
}
};

const value = 20;
const getValue = obj.getValue();
console.log(getValue());
  • πŸ‘ 3
  • πŸ”₯ 3
Post #1787 6.58K
  • 🀣 14
  • πŸ‘ 10
  • ❀ 4
  • 🀩 2
Post #1786 6.34K
CHALLENGE

function Animal(name) {
this.name = name;
}
Animal.prototype.sound = 'Generic sound';

const dog = new Animal('Dog');

Animal.prototype.sound = 'Bark';
console.log(dog.sound);
  • πŸ‘ 3
Post #1784 6.6K
  • πŸ‘ 13
  • πŸ”₯ 5
  • 🀣 4
  • ❀ 3
Post #1783 6.45K
CHALLENGE

async function test() {
console.log(1);
await new Promise(resolve => setTimeout(resolve, 1000));
console.log(2);
return 3;
}

console.log(4);
test().then(console.log);
console.log(5);
  • πŸ‘ 3
  • πŸ”₯ 1
Post #1781 6.68K
  • 🀣 30
  • πŸ‘ 7
  • ❀ 3
  • πŸ”₯ 1
Post #1780 6.39K
CHALLENGE

console.log(typeof NaN);
console.log(NaN === NaN);
  • 🀣 21
  • πŸ€” 5
  • ❀ 2
Post #1779 6.89K
🀟 Node v23.0.0 (Current) Released

Say hello to the newest release line of Node.js that gets all the cutting edge features first (Node 22 will soon become the active LTS release). v23 notably enables support for loading ES modules with require() by default, drops 32-bit Windows support, and node --run goes stable.

Rafael Gonzaga
  • ❀ 10
  • πŸ‘ 4
  • πŸ”₯ 3
Post #1778 6.38K
  • πŸ‘ 18
  • πŸ€” 8
  • πŸ”₯ 2
Post #1777 6.43K
CHALLENGE

function Person(name) {
this.name = name;
}

Person.prototype.greet = function () {
console.log(`Hello, ${this.name}`);
};

const person = new Person('Alice');
person.greet();

console.log(person.hasOwnProperty('greet'));
  • πŸ‘ 7
Post #1775 6.1K
  • πŸ€” 25
  • πŸ‘ 14
  • 🀩 7
  • πŸ”₯ 5
  • 🀣 2
Post #1774 6.35K
CHALLENGE

for (var i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 100);
}
  • ❀ 4
  • πŸ‘ 3
Post #1773 10.3K
🀟 To ensure your Node.js version is secure, use:


npx is-my-node-vulnerable


A tool created and maintained by the Node.js security team. This utility allows you to quickly check for known vulnerabilities and helps safeguard your projects.
  • πŸ‘ 13
  • ❀ 6
  • πŸ”₯ 6
  • 🀩 2
Post #1772 6.1K
  • πŸ”₯ 8
  • πŸ‘ 3
Post #1771 6.34K
CHALLENGE ❓


const sym = Symbol('unique');
const obj = {
[sym]: 'Secret',
public: 'Visible'
};

console.log(Object.keys(obj));
console.log(obj[Symbol('unique')]);
  • πŸ‘ 2
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 β†’