You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Credential Management API を使用する前に、まず PasswordCredential または FederatedCredential がサポートされているかどうかを確認します。 if (window.PasswordCredential || window.FederatedCredential) { // Call navigator.credentials.get() to retrieve stored // PasswordCredentials or FederatedCredentials. } ユーザーのログイン ユーザーをログインさせるには、ブラウザのパスワード マネージャーから認証情報を取得し、その認証情報を使用してユーザーをログインさせます。 次に例を示します。 ユーザーがサイトにアクセスしてログインしていない場合は、navigator.cre
ECMAScriptの浮動小数点数の丸め関数である Number.prototype.toFixed() について調べてみたところ、浮動小数点数をわかっている人が作った硬派な仕様だと感じたので、解説してみます。 浮動小数点数の丸めの善し悪しについて 私はプログラミング言語の浮動小数点数の丸め処理に興味があり、過去に関連記事を30本以上書いています。こうした活動から得られた知見として、良い丸め関数には次のような性質があると考えています。 仕様がシンプルで直感的であること 仕様が抜け漏れなく文書化されていること バグを作り込みにくい仕様であること どれも良い関数の一般論のような話ですが、丸め処理に限って言えば簡単な話ではありません。そもそも浮動小数点数の性質が人の直感に反するため利用者にとっても実装者にとっても罠が多く、結果として上の条件を満たせないことが多いのです(私が面白いと感じるポイント
Intro ECMAScript の Private Class Field の仕様策定と各ブラウザの実装が進んでいる。 これにより、従来の JS にはなかった Class の Private フィールドが使えるようになる。 提案されている構文や、挙動について解説する。 Class Field Declaration まず前提として、現状の Class の フィールドはコンストラクタで定義する必要がある。 例えば count フィールドを持つ Counter クラスを定義した場合、以下のようになる。 class Counter { constructor() { this.count = 0 } increment() { this.count ++ } display() { console.log(this.count) } } const c = new Counter() c.in
一部の機能をパフォーマンス改善したときにそれを計測したり、データを集めたいときがあります。 しかし、それだけのためにライブラリを追加するのも面倒くさい(実装後に計測コードは外すので)し、コンソールに結果を出すのもデータ収集的にイマイチです。 // よくあるコンソールに表示するパフォーマンス計測コード const start = performance.now(); // ------------ // 計測したい処理を書く // ------------ console.log(`${performance.now() - start}ms`); 結果をコピーしてSpreadSheetなどで可視化できたり、処理時間と関連する要素も保存しておきたいです。 (コンソールに出力すると埋もれたり、加工がめんどうです) そのようなときによく使っているPerformance.mark()とPerfor
ULIDs are unique, sortable identifiers that work much in the same way as UUIDs, though with some improvements: Lexicographically sortable Canonically encoded as a 26 character string, as opposed to the 36 character UUID Uses Crockford's base32 for better efficiency and readability (5 bits per character) Monotonic sort order (correctly detects and handles the same millisecond) ULIDs also provide: 1
const onIntersection = (entries) => { for (const entry of entries) { if (entry.isIntersecting) { console.log(entry); } } }; const observer = new IntersectionObserver(onIntersection); observer.observe(document.querySelector('#some-target')); What's challenging with Intersection Observer v1? To be clear, Intersection Observer v1 is great, but it's not perfect. There are some corner cases where the A
DeskGap¶ DeskGap is a framework for building cross-platform desktop apps with web technologies (JavaScript, HTML and CSS). To enable native capabilities while keeping the size down, DeskGap bundles a Node.js runtime and leaves the HTML rendering to the operating system‘s webview. Supported Platforms¶ macOS Windows Linux
In recent years, JavaScript has grown considerably in size. This blog post explores what’s still missing. Notes: I’m only listing the missing features that I find most important. Many others are useful, but there is also a risk of adding too much. My choices are subjective. Almost everything mentioned in this blog post is on TC39’s radar. That is, it also serves as a preview of a possible future J
SWC is an extensible Rust-based platform for the next generation of fast developer tools. It's used by tools like Next.js, Parcel, and Deno, as well as companies like Vercel, ByteDance, Tencent, Shopify, Trip.com, and more. SWC can be used for both compilation and bundling. For compilation, it takes JavaScript / TypeScript files using modern JavaScript features and outputs valid code that is suppo
Limited edition tshirts are now available to buy! $10 per tshirt goes to maintain the project. What is Prettier?An opinionated code formatterSupports many languagesIntegrates with most editorsHas few options » Why?Your code is formatted on saveNo need to discuss style in code reviewSaves you time and energyAnd more »
ECMAScript 2018で正規表現の戻り読み(lookbehind)が追加されました。 /(?<=foo)bar/.test('foobar'); // => true 'foobar'.replace(/(?<=foo)bar/, 'baz'); // => 'foobaz 正規表現の戻り読みと言えばPerlでは1998年7月リリースのバージョン5.005からサポートしており、そこから20年もたってと思いたくなるかもしれません。しかし、ECMAScript (JavaScript)のそれはPerlのものとは一味違います。なんと戻り読みの中で量指定子(*、+、?、{n}など)を使えるのです。 // JavaScriptなら(?<=...)の中で+が使える。 /(?<=fo+)bar/.test('foobar'); // => true # Perlでは(?<=...)の中で+を使お
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く