#フロントエンド #設計 #JavaScript 「1個の要素と複数個の要素を同じように書かせる」というのが実は jQuery の特徴の一つだと思っている。 document.querySelector() や querySelectorAll が出現して以降 jQuery の必要性はほとんどなくなったと言われる。 実際にこんなサイトもあるし https://youmightnotneedjquery.com/ これは実際その通り 一方、jQuery で書かれたコードを querySelector や querySelectorAll に移行しようとしたら苦しかったという経験をした人は多そう。 上のコードが下のようになる。 code:javascript $('.foo').on('click', e => { // ... }) Array.from(document.querySele
Webブラウザ上でWebAssemblyベースのNode.js環境を実現する「WebContainer」がAPI提供開始。ブラウザ内ファイルシステム、HTTPサーバ、Node.js CLIなど WebAssemblyを用いてWebブラウザ上でNode.js環境を実現する「WebContainer」などを提供するStackBlitzは、WebContainerにアクセスできるAPIの提供を開始したと発表しました。 Today, after years of battle testing by millions of developers, in collaboration with browser vendors: WebContainer API is now available to everyone. Start building the next generation of inte
先日、次のような JavaScript クイズを Twitter で出しました。 // JavaScript quiz: 出力は? const a = []; { for(let i = 0; i < 10; i++) { a[i] = () => console.log(i); } } a[3](); { let i; for(i = 0; i < 10; i++) { a[i] = () => console.log(i); } } a[3](); { for(let i = 0; i < 10;) { a[i] = () => console.log(i); i++; } } a[3](); — Takuo Kihira (@tkihira) August 15, 2022 答えは 3, 10, 4 なのですが、for 文の let 初期化専用の例外処理がない場合は 10, 10,
Dataflow Proposals とは 以下の5つのプロポーザルをまとめて Dataflow Proposals と呼んでいる。 Stage 2: Pipe operator Stage 1: Call-this operator Stage 1: Partial application(PFA) Stage 1: Extensions Stage 0: Function.pipe and flow 例えば Pipe operator, Call-this operator, Partial application を組み合わせると、以下のように書けるようになる。(提案段階なので変わる可能性アリ) import { getAuth, getIdToken } from "firebase/auth"; function isPublic(article) { return articl
MilkScript makes it easy to automate a wide variety of things—for example, creating tasks from templates, removing unused tags, generating task reports, and more. How this works You write code in modern JavaScript and have access to a built-in library that allows you to manage tasks in your Remember The Milk account. There's nothing to install—we give you a code editor right in your browser, and y
Today we’re excited to announce our support and collaboration on a new Stage 0 proposal to bring optional and erasable type syntax to JavaScript. Because this new syntax wouldn’t change how surrounding code runs, it would effectively act as comments. We think this has the potential to make TypeScript easier and faster to use for development at every scale. We’d like to talk about why we’re pursuin
CodeCaptcha.ioHide your web link behind a mini-coding challenge. What's CodeCaptcha?Sometimes you want to share a link (like job postings, google forms, your project, a secret sub-page etc) to programmers only. This service let's you do that while also preventing abuse and spam. How does it work?It creates a unique link that you can share instead of your unprotected original link. Visitors are pre
Safe DOM manipulation with the Sanitizer API Stay organized with collections Save and categorize content based on your preferences. The new Sanitizer API aims to build a robust processor for arbitrary strings to be safely inserted into a page. Applications deal with untrusted strings all the time, but safely rendering that content as part of an HTML document can be tricky. Without sufficient care,
JavaScriptには殆ど知られていませんが、環境によって5種類のコメント構文が存在します。厳密な内容は以下の仕様書をご覧いただくとして、この記事では概要を確認します。 Comments 仕様書 12.9より。これが一般的に誰でも知っているコメントです。 MultiLineComment(複数行コメント)
ES2021 Features! Logical Assignment Operators (&&= ||= ??=) Numeric Separators (1_000) Promise.any & AggregateError String.prototype.replaceAll WeakRefs & FinalizationRegistry Objects Logical Assignment Operators Logical Assignment Operators 📖. //"Or Or Equals" x ||= y; x || (x = y); // "And And Equals" x &&= y; x && (x = y); // "QQ Equals" x ??= y; x ?? (x = y);const updateID = user => { // We c
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く