gram news
Аватар канала 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

31,300подписчиков

Открыть канал

Последние посты

  • JavaScript

    23 сент., 07:42

    🤩 tinyjs: Build JavaScript Desktop Apps in <10MBI built an app with this and was impressed. You get a txiki.js-powered backend with full system access (including FFI!), native webview rendering, and tiny macOS, Linux, and Windows builds. It even makes it easy to sign/notarize the final app.Tarwin Stroh-Spijer
    Иллюстрация к посту канала JavaScriptИллюстрация к посту канала JavaScript
  • JavaScript

    23 сент., 06:31

    CHALLENGEfunction inner() { yield 1; yield 2; return 100; }function outer() { const result = yield inner(); yield result; yield 3; }const it = outer(); console.log(it.next().value, it.next().value, it.next().value, it.next().value);
  • JavaScript

    22 сент., 06:32

  • JavaScript

    22 сент., 06:32

    CHALLENGEfunction Foo(x) { this.x = x; return { x: x 2 }; }function Bar(x) { this.x = x; return 42; }const f = new Foo(5); const b = new Bar(5);console.log(f.x, b.x, f instanceof Foo, b instanceof Bar);
  • JavaScript

    21 сент., 06:30

  • JavaScript

    21 сент., 06:30

    CHALLENGEconsole.log( typeof typeof 1, 1 + typeof 1, 2 3 2, 1 + 2 + '3', 1 < 2 < 3, 3 > 2 > 1 );
  • JavaScript

    20 сент., 06:31

    1,060опрос3Открыть в Telegram
  • JavaScript

    20 сент., 06:31

    CHALLENGE'use strict';function getValue() { return this.value; }const obj = { value: 42, getValue }; const fn = obj.getValue;try { fn(); } catch (err) { console.log(err.constructor.name, typeof this); }
  • JavaScript

    19 сент., 06:31

    1,150опрос33Открыть в Telegram
  • JavaScript

    19 сент., 06:31

    CHALLENGEconst a = 5 & 3; const b = 5 | 2; const c = ~5; const d = 1 << 31; const e = -1 >>> 28; const f = 5 ^ 5; console.log(a, b, c, d, e, f);
  • JavaScript

    18 сент., 06:31

    1,320опрос6Открыть в Telegram
  • JavaScript

    18 сент., 06:31

    CHALLENGElet i = 0; const key = () => k${i++}; const obj = { [key()]: i, [key()]: i, [key()]: i, }; console.log(Object.keys(obj).join(','), obj.k0, obj.k1, obj.k2);
  • JavaScript

    17 сент., 06:31

  • JavaScript

    17 сент., 06:31

    CHALLENGEconst nums = [1, 2, 3, 4, 5]; const result = nums .filter(n => n % 2 !== 0) .map(n => n 2) .reduce((acc, n) => acc + n, 0);const arr = [10, , 20, undefined, 30]; const mapped = arr.map(x => x 2);console.log(result, mapped);
  • JavaScript

    16 сент., 06:30

    1,500опрос43Открыть в Telegram
  • JavaScript

    16 сент., 06:30

    CHALLENGElet count = 0; const inc = () => (count += 1, count); const a = 0 || inc(); const b = null ?? inc(); const c = a && inc(); const d = b?.toString() || inc(); console.log(a, b, c, d, count);
  • JavaScript

    15 сент., 06:31

    1,640опрос52Открыть в Telegram
  • JavaScript

    15 сент., 06:31

    CHALLENGEconst a = [] + []; const b = [] + {}; const c = {} + []; const d = 1 + "1" - 1; console.log(a, b, c, d);
    1,510221Открыть в Telegram
  • JavaScript

    14 сент., 06:32

    1,750опрос5Открыть в Telegram
  • JavaScript

    14 сент., 06:32

    CHALLENGEfunction Timer() { this.seconds = 0; this.tick = () => { this.seconds++; }; this.tickRegular = function () { this.seconds++; }; }const t = new Timer(); const { tick, tickRegular } = t; tick();let regularResult; try { tickRegular(); regularResult = 'no error'; } catch (e) { regularResult = e instanceof TypeError; }