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
899

Showing posts older than #2052 Β· Back to latest

Older Posts 20 shown
Post #2051 6.08K
CHALLENGE

'use strict';

function strictModeExample() {
undeclaredVariable = 10;
try {
console.log(undeclaredVariable);
} catch (e) {
console.log('Error:', e.message);
}
}

strictModeExample();
  • πŸ‘ 7
  • 🀣 4
  • ❀ 2
Post #2050 6.47K
πŸ‘ A Protracker Module Player in Pure JavaScript

I’m a sucker for 90s tracker music, JavaScript experiments, and cool Web experiences, and this has all three. If you’re not familiar with tracker music, it’s a way to write music on a grid which triggers the playing of samples. This code manages to parse and play a Protracker file in pure JavaScript. (Note: The image above is of the original Protracker app, this experiment is more minimal and about the code.)

srtuss
  • ❀ 4
  • πŸ‘ 3
  • πŸ”₯ 1
Post #2049 6.15K
  • πŸ€” 38
  • πŸ”₯ 15
  • πŸ‘ 13
  • 🀣 8
  • ❀ 2
Post #2048 6.25K
CHALLENGE

let a = 5;
let b = a++ + ++a;
console.log(b);
  • 🀣 24
  • πŸ”₯ 8
  • πŸ‘ 5
Post #2046 6.49K
  • πŸ€” 18
  • πŸ‘ 7
  • 🀩 7
  • ❀ 6
Post #2045 6.24K
CHALLENGE

const a = '5';
const b = 5;
const c = 10;

const result1 = a == b;
const result2 = a === b;
const result3 = b < c;
const result4 = b >= c;

console.log(result1, result2, result3, result4);
  • πŸ‘ 9
  • ❀ 3
Post #2044 6.6K
✌️ Oracle Claims 'JavaScript' Isn't a Generic Term, and More

In this 'motion to dismiss' Oracle has responded to Deno’s attempt to prove Oracle shouldn't hold the JavaScriptβ„’ trademark with the argument that β€œrelevant consumers do not perceive JAVASCRIPT as a generic term” (does Oracle only consider people who give it money to be relevant?) among other comedic insights.

Ryan Dahl
  • 🀣 12
  • πŸ‘ 8
  • ❀ 1
Post #2043 6.09K
  • 🀣 32
  • πŸ‘ 11
  • ❀ 8
  • 🀩 2
Post #2042 6.13K
CHALLENGE

const person = {
firstName: 'John',
lastName: 'Doe',
age: 30,
getFullName: function() {
return this.firstName + ' ' + this.lastName;
}
};

console.log(person.getFullName());
  • 🀣 27
  • πŸ‘ 3
  • ❀ 2
Post #2040 6.72K
  • ❀ 22
  • πŸ‘ 18
  • 🀣 6
  • πŸ”₯ 3
Post #2039 6.35K
CHALLENGE

function example() {
console.log(a);
var a = 10;
console.log(a);
}
example();
  • πŸ‘ 2
  • πŸ€” 2
  • ❀ 1
Post #2038 7.03K
  • πŸ‘ 22
  • πŸ”₯ 4
  • ❀ 2
Post #2037 6.68K
CHALLENGE

const person = {
name: 'Alice',
age: 25,
city: 'Wonderland'
};

const additionalInfo = {
age: 30,
occupation: 'Explorer'
};

const combined = {
...person,
...additionalInfo
};

console.log(combined.age);
  • πŸ‘ 12
  • πŸ”₯ 3
Post #2036 6.52K
  • πŸ‘ 21
  • πŸ€” 6
  • πŸ”₯ 5
  • ❀ 3
Post #2035 6.72K
CHALLENGE

const numbers = [1, 2, 3, 4, 5];

const result = numbers
.filter(n => n % 2 === 0)
.map(n => n * 2)
.reduce((acc, n) => acc + n, 0);

console.log(result);
  • ❀ 5
  • πŸ‘ 2
Post #2033 6.74K
  • 🀣 15
  • πŸ‘ 9
  • ❀ 5
  • πŸ€” 4
Post #2032 6.64K
CHALLENGE

const wm = new WeakMap();
const obj1 = {};
const obj2 = {};
wm.set(obj1, 'object 1');
wm.set(obj2, 'object 2');
wm.delete(obj1);
console.log(wm.has(obj1));
  • πŸ‘ 9
  • ❀ 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 β†’