概要 次のようなコードをよく見ます。 undefined = 1; // 1 (function () { var undefined; // 同名のローカル変数を定義 alert(undefined); // undefined })(); ところが、ECMAScript 5.1 規定の undefined は書き換え不可能([[Writable]]: false)です。 15.1.1.3 undefined # Ⓣ Ⓡ The value of undefined is undefined (see 8.1). This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. http://es5.github.com/#x15.1.1.3
The humble var keyword has been with us since the very beginning of JavaScript. With ECMAScript 6, we’re gaining new ways to declare variables and even constants. Now that browser support is starting to improve, I’d like to take the opportunity to run through what we have now, what is coming up on the horizon. If you have any experience with JavaScript, you probably know at least something about v
(or tomorrow's syntax, today!) Modules are one of the most interesting and useful additions coming in ES6, the next version of JavaScript. A lack of universal module support has long been a pain point for JavaScript. While it's been understood for a long time that simply concatenating files together isn't going to cut it when you start developing complicated applications and dependency trees, the
ある意味、ソーシャルボタンのJavaScriptでfunctionの前に「!」がついている理由の続き。 今回は ECMAScript 6th から入る ArrowFunction で即時関数を考える巻。 前回は普通の関数式での即時関数を解説してみた。 functionには2種類ある いきなり function から書くと式とは認識されないから一工夫が必要 という話だった。 さて、もし、function には1種類しかなく、式としての関数式のみだったら、きっと ExpressionStatementの先頭にfunctionが来てはならないという宣言が設けられることは無かっただろう。 それを踏まえて、ArrowFunctionを見てみると、これは1種類の式のみの定義だ。 では、 () => { // .... }(); と書けるはず! と思うだろう。 しかし、しかしながら、こう書くと構文エラー
Looking for a list of all reserved words in JavaScript? You’ve come to the right place. I recently needed such a list myself, but ended up comparing the reserved keywords in all ECMAScript versions as well. The result is listed below, for future reference. ECMAScript 1 In the beginning, there was ECMAScript 1. It listed the following reserved words: do if in for new try var case else enum null thi
This blog post demonstrates how to use ECMAScript 6 proxies to automatically bind methods that are extracted from an object. The problem with extracting methods It’s a common JavaScript gotcha: If you extract a method from an object, it becomes a normal function. It loses the connection to the object and acessing properties via this doesn’t work, any more. Let’s look at an example: var jane = { na
このページ は、このページの URL パス下にある,ウェブプラットフォーム関連の仕様の日本語訳の一覧と,各ページに共通する事項についての説明です。 これらの翻訳の正確性は保証されません。 これらの仕様の公式な文書は英語版であり、日本語訳は公式のものではありません。 一部の仕様(特に WHATWG によるもの)は日々更新され続けているので、日本語訳には最新版ではないものもあります。 また、原文の更新に伴う,ページ更新の際に見落としがあるかもしれません(更新部分の日本語訳への複製/統合段階など)。 その完全性は保証されませんが、不定期に検証されてはいます。 Jacascript / CSS / DOM の対応が古いブラウザでは、表示が崩れたり,一部の機能が働かないかもしれません(特に IE 6〜8 はほとんど考慮されていません)。 例えば目次など,一部ページ内容はスクリプトで自動生成されていま
Anonymous said... Current stand of TC39 is that __proto__ will standardized and Object.setPrototypeOf is no go. As long as that remains unchanged, adding setPrototypeOf to our code is just adding not standard mess, I wouldn't advocate that. Maybe if there would be more of us, pushing for setPrototypeOf, something would happen, at least we all feel, that with some effort it can be done. Reasons aga
Firefox Nightly (22) に ES6のArrow Function来たる - fragmentary ということで、早速試しているわけです。 基本 var f1 = () => "OK"; // 引数なしの場合は、"()"が必須 var f2 = arg => arg + 1; // 引数一つなら、"()"は省略可 var f3 = (arg1, arg2) => arg1 + arg2; // 複数の引数の場合は"()"必須 var f4 = arg => { // ステートメントを入れる場合は "{}" でブロックを生成する if (arg) return "OK"; else return "NG"; }; // オブジェクトを返す場合は、ブロックと間違われないように // ({...}) と () 等を使用する var f5 = () => ({ a: "A", b
Our goal is to provide information on the importance of modularity in programming Aspect-Oriented Software Development is website that promotes using modularity in programming.
前回はJavaScriptのプロトタイプチェーンについて、図解を用いることでなんとか理解できました。今回はスコープチェーンに挑戦してみます。前回と同じく「1. 図解を用いる」「2. 用語を明確に定義する」「3. Standard ECMA-262 3rd editionを情報ソースとする」というアプローチで紐解いて行きます。 用語の定義 ・本エントリの文章における表記は、以下の表の「ECMA-262 3rd」に統一する ・本エントリの図における表記は、以下の表の「本エントリの略称」に統一する ・本エントリ内におけるES3とは、Standard ECMA-262 3rd editionを指す ECMA-262 3rd 本エントリの略称 JavaScript(サイ本)第5版(日本語) Execution Contexts EC 実行コンテキスト Variable Object VO 変数定義の
ChromeのExperimental WebKit/JavaScript Features - fragmentary Experimental JavaScript Features の方に Symbol が使えると書かれていたので早速。 Symbol ってのはなんて言うか、固有のプロパティのキーになれるもの?っていう説明で良いのかな。 var s = new Symbol(); var obj = {}; obj[s] = "OK"; obj[s] // "OK"; obj[s]の s は文字列化されずに、Symbolそのものとして動く。文字列キーとしては存在しないためs を使わずに得ることは不可能なのだ。 "use strict"; (function(global){ var className = new Symbol, name = new Symbol; var BaseP
ECMAScript 6 and Object Literal Property Value Shorthand Feb 28, 2013 2 min read #es6 #javascript #web Constructing an object using the literal syntax is something that is very familiar to every JavaScript developer, quite likely because this reminds everyone of JSON. While every object property needs to be either a key-value pair or getter/setter, this may change in the near future. Another synta
EngineeringHijacking Amazon EventBridge for launching Cross-A...Securing the invisible paths: How cross-account event flows can become security ... Data ScienceRevamping Data Science InterviewsInterviews are not just about improving hiring outcomes - they are about strengt... EngineeringRoBERTa Model for Merchant Categorization at Squar...Harnessing Large Language Models to Deliver Accurate Busine
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く