自己紹介 @kyo_ago ChatWorkの中の人です 普段はLT中心 ApplicationCacheとかSSEとかCSSを何とかしたい人 (自覚は無いです)
概要 インスタンスであるか判定するためのビルトインシンボルが実装された。 解説 instanceof演算子が「 obj instanceof C 」の形で使われると、「 C[@@hasInstance] 」が定義されていた場合objを引数に呼ばれ、それが返す真偽値が返される。 class X { } class A { static [Symbol.hasInstance](obj) { return obj.constructor == X } } let a = new A, x = new X console.log( a instanceof A ) // false console.log( x instanceof A ) // true ちょっと変わった利用例 型判定に使う const StringOrNumber = { [Symbol.hasInstance](v) {
何かJavaScriptのソースコードを機械的にチェックするためのツールを作りたいという場合に、JavaScriptのASTというものを触る必要が出てくると思います。 この記事では、その取っ掛かりとなる案内を簡単にまとめたものです。 ASTとは AST(Abstract Syntax Tree)はコードをパースした抽象構文木のこと。 JavaScriptの場合はJavaScriptオブジェクト(JSON)として表現されます。 コード: { "range": [ 0, 10 ], "type": "Program", "body": [ { "range": [ 0, 10 ], "type": "VariableDeclaration", "declarations": [ { "range": [ 4, 9 ], "type": "VariableDeclarator", "id": {
JavaScriptはWebブラウザさえあればはじめられるという手軽さの反面、学習しようと思った際のステップはあまり用意されていないように見えます。しかしJavaScriptの入門になる学習サイトも増えてきています。 そうしたオンラインサイトを使ってJavaScriptの学習をはじめてみるのはいかがでしょう。 ドットインストール 3分動画を通じてプログラミングを学べるドットインストールのJavaScriptタグでは多くのJavaScriptを使ったレッスンが登録されています。入門から実際にWebアプリケーションを作ってみる実践的なレッスンなどレベルも幅広く用意されています。 CodeStudy CodeStudyではWebブラウザ上でゲーム感覚でJavaScriptが学べるようになっています。シェアする機能を通じて友達と学習レベルを競ったり、分からないところを聞いたりすることもできます。
For the past few months, I’ve been on adventure learning everything I could about functional programming. It seems like every week there’s a new frontend framework or library claiming some inspiration from functional programming, so I decided to check it out. One of my explorations was into Elm: an amazing Haskell-inspired language for building web applications. It gave me a taste of what function
This article was peer reviewed by Simon Codrington. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! In a previous article, I demonstrated how to build a basic Gmail inbox and message viewing app using the Gmail JavaScript API. Today I’m going to enhance that app with email sending capability using Gmail’s powerful back-end. We’ll end up with a customiza
Elm uses type inference to detect corner cases and give friendly hints. NoRedInk switched to Elm about four years ago, and 300k+ lines later, they still have not had to scramble to fix a confusing runtime exception in production. Learn more. -- TYPE MISMATCH ---------------------------- Main.elm The 1st argument to `drop` is not what I expect: 8| List.drop (String.toInt userInput) [1,2,3,4,5,6] ^^
Extensible and CustomizableWe provide the building blocks to enable the creation of a broad variety of rich text composition experiences, from basic text styles to embedded media. Declarative Rich TextDraft.js fits seamlessly into React applications, abstracting away the details of rendering, selection, and input behavior with a familiar declarative API. Immutable Editor StateThe Draft.js model is
pnpm Performant npm installations pnpm is a fast implementation of npm install . It is loosely based off ied . :warning: Name change The npm package was changed from pnpm.js (0.15 and below) to pnpm . The old package will no longer be updated. For old users, uninstall the old version and install the new one: npm uninstall -g pnpm.js npm install -g pnpm Install Install it via npm. npm install -g pn
SpiritThe ultimate tool to create high-quality animations directly in the browser. Important Notice: I want to extend my deepest gratitude to everyone who has supported Spirit over the years. After careful consideration, I have made the difficult decision to discontinue Spirit as a service. Read more ...
日々の仕事の中で役に立つES2015(ES6)のティップス、コツ、ベストプラクティス、プログラムの見本をご紹介します。コントリビューション歓迎です! 目次 var vs. let / const IIFEからブロックベースへ アロー関数 文字列 デストラクチャリング モジュール パラメータ クラス シンボル マップ WeakMaps Promises ジェネレータ Async/Await var vs. let / const var の他に、値を格納する let と const という識別子が新たに追加されました。 var とは異なって、 let と const はクロージャのスコープ内で最初に記述されることはありません。 var の使用例です。 var snack = 'Meow Mix'; function getFood(food) { if (food) { var snack
audience: who is this book for how to read this book special thanks technical editor the author what this book is about what this book is not debug comments operators parenthesis brackets references variables constants types invoke function declaration VS function expression named function expressions scope private and nested scope context global context method context invoking a function via call
The definitive source of the best JavaScript libraries, frameworks, and plugins. ▶
Touchpoint-js A vanilla JavaScript library that visually shows taps/clicks for HTML prototypes using CSS3 transitions on desktop and mobile. View on GitHub Download .zip Download .tar.gz <<<<<<< d5d24096b463201e3795feb5d2887428963b88a8 A tiny (3.86 kb minified) vanilla JavaScript library made for in-browser HTML prototyping (as part of the UX process) that visually shows where the user clicks/taps
Pretty much the best plugin in the world. A simple jQuery plugin to display current weather data for any location and doesn't get in your way. Now supports HTML5 GeoLocation! Handcrafted with ♥ from Boston, MA by James Fleeting. Download v3.1.0 Last updated on January 29, 2016 More ways to install bower install simpleWeather Tweet Introducing simpleWeather See the Pen simpleWeather.demo.js by Jame
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く