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 #2072 Β· Back to latest

Older Posts 20 shown
Post #2071 5.97K
CHALLENGE

const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };
const mergedObj = { ...obj1, ...obj2 };
console.log(mergedObj);
  • πŸ‘ 10
Post #2070 6.19K
πŸŒͺ GitHub Extends Its Monaspace Font Family

Monaspace is a fantastic set of monospaced fonts from GitHub targeted at coding use cases. Its new v1.2 release ups the ante by including Nerd Fonts support and symbols, new box drawing glyphs, characters, character variants, ligatures, and more.

GitHub
  • πŸ‘ 10
  • ❀ 2
  • πŸ”₯ 1
  • 🀣 1
Post #2069 5.82K
  • ❀ 17
  • 🀣 9
  • πŸ‘ 5
  • πŸ€” 1
Post #2068 5.89K
CHALLENGE

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

Person.prototype.getDetails = function() {
return this.name + ' is ' + this.age + ' years old.';
};

const john = new Person('John', 25);
console.log(john.getDetails());
  • πŸ‘ 11
  • ❀ 1
Post #2067 6.12K
✌️πŸ₯Ά Ohm: A Parsing Toolkit for JavaScript and TypeScript

It’s been a few years since we covered this project and it’s come along a lot. It’s a library for building PEG-based parsers you can use in interpreter, compilers, analysis tools, etc. and you can even play with its grammar online.

Warth, Dubroy, et al.
  • ❀ 3
  • πŸ‘ 3
  • πŸ€” 1
Post #2066 5.84K
  • πŸ”₯ 10
  • πŸ€” 9
  • 🀣 6
  • πŸ‘ 5
Post #2065 5.63K
CHALLENGE


let weakmap = new WeakMap();

let obj1 = {};
let obj2 = {};

weakmap.set(obj1, 'value1');
weakmap.set(obj2, 'value2');

obj1 = null;

console.log(weakmap.has(obj1));
  • ❀ 8
  • πŸ‘ 1
Post #2064 5.98K
πŸ‘€ Style Observer: A Library to Observe CSS Property Changes

Lea Verou is a developer who’s easy to admire because whenever she sets out to solve a problem, the results are always fully formed with no cut corners. So it goes with this β€˜exhaustively tested’ JS library for observing changes to CSS properties which deftly handles lots of browser quirks. See the project homepage for more. (TIL there’s a .style TLD!)

Lea Verou
  • πŸ‘ 5
  • πŸ€” 4
  • ❀ 2
Post #2063 5.65K
  • πŸ‘ 15
  • πŸ€” 5
  • ❀ 3
  • πŸ”₯ 2
Post #2062 5.92K
CHALLENGE

const promise = new Promise((resolve, reject) => {
reject('Error occurred');
});

promise
.then(() => {
console.log('Promise resolved!');
})
.catch(error => {
console.log(error);
})
.then(() => {
console.log('Process completed');
});
  • πŸ‘ 5
  • πŸ”₯ 3
Post #2061 6.4K
πŸ˜†
  • 🀣 89
  • πŸ‘ 3
  • 🀩 3
Post #2060 6.08K
  • πŸ‘ 10
  • πŸ€” 9
  • 🀣 4
  • ❀ 2
Post #2059 6.29K
CHALLENGE

function outerFunction() {
let x = 10;
function innerFunction() {
x += 5;
console.log(x);
}
return innerFunction;
}

const closureFunc = outerFunction();
closureFunc();
closureFunc();
  • πŸ€” 12
  • πŸ‘ 10
Post #2057 6.46K
  • πŸ‘ 8
  • ❀ 3
  • πŸ”₯ 2
Post #2056 6.35K
CHALLENGE

const symbol1 = Symbol('symbol');
const symbol2 = Symbol('symbol');

const obj = {};
obj[symbol1] = 'value1';
obj[symbol2] = 'value2';

console.log(obj[symbol1]);
  • πŸ‘ 4
Post #2055 6.66K
🀟 How to Publish ESM-Based npm Packages with TypeScript

Now that you can use the ES modules (almost) everywhere, it’s worth understanding how to package them up for use with npm. Axel digs into everything you need to know and shares some useful tools too.

Dr. Axel Rauschmayer
  • πŸ‘ 4
  • ❀ 3
  • πŸ”₯ 1
Post #2054 6.13K
  • πŸ‘ 5
  • πŸ€” 3
Post #2053 6.08K
CHALLENGE

function* numberGenerator() {
yield 1;
yield 2;
yield 3;
}

const gen = numberGenerator();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
  • πŸ‘ 11
  • ❀ 2
  • πŸ”₯ 1
Post #2052 6.53K
  • ❀ 12
  • πŸ‘ 9
  • πŸ€” 4
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 β†’