【爱游戏ayx体育登录】(中国)官方入口|登录 404 Not Found nginx XML 地图 | Sitemap 地图
Today, at SXSW, I hosted a panel discussion on the “Secrets of JavaScript Libraries.” We set out to discuss the behind-the-scenes nitty-gritty code that powers the universal features of the most popular JavaScript libraries. I think the presentation went quite well. I think we could’ve, easily, done a 2 hour talk with all the content that we had (we had to chop off, at least, two sections at the e
JavaScript RHG読書会::東京 入門JavaScript 第四回 - ヒビルテ (2007-04-14) はじめてしりました。 // Firebug出力のショートカット function p(x){console.log(x)} // evalの基本を確認 var context = {a : 50}; // evalのコンテキストオブジェクト p(context.eval("a")) // 50 contextの上で評価 p(eval("a", context)) // 50 入れ替えても同じ // カウンタクロージャーを生成する関数 function counter(){ var num = 0; return function(){ return ++num; } } // 実際にカウンターを作成 var count = counter(); p(count());
[追記]id:zorioさんのブックマークコメントの指摘により、抜けていた「.apply」を挿入しました。[/追記] JavaScriptで、大域変数(大域オブジェクトのプロパティ)fooが存在しないときに何かをしたいとしましょう。例えば、こんな書き方をしますよね。 if (!foo) { // 何か } でも、式 !foo は、fooがnullでもfalseでも0でもtrueに評価されます。 if (foo == undefined) { // 何か }としたほうがよさそうです。が、null == undefined もtrueとなるのであまり改善されてません。 if (foo === undefined) { // 何か }イコールが3つなら、厳密に「fooが未定義値であるとき」を表現します。ここで、undefinedはリテラルではなくて、仕様として事前に定義されている大域変数です。u
Earlier today a friend of mine, Marc Grabanski, pinged me with a question: What’s the optimal way, in JavaScript, to convert a query string like “foo=1&foo=2&foo=3&blah=a&blah=b” into one that looks like this: “foo=1,2,3&blah=a,b”. He had already come up with a solution of his own and was curious as to if it could be improved upon. I pondered this for a moment and came up with a solution: function
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く