この記事では、JavaScriptのNaNについて改めて学ぶという趣旨の話をします。 JavaScriptで、文字列などから数値へ値を変換したいことがあると思います。 典型的なケースでは、ユーザーに入力してもらった数字となる文字列を、Number型へ変換するというケースです。 この場合、Numberコンストラクタ関数やNumber.parseInt、Number.parseFloatなどが利用できます。(ここでは、Number.parseIntにしていますが、parseIntと同じです) // ユーザー入力を文字列として受け取る var input = window.prompt("数字を入力してください", "42"); // 文字列を数値に変換する var number = Number(input); console.log(typeof number); // => "number
There’s a tool in CSS that you might not have heard of yet. It’s powerful. It’s been there for a while. And it’ll likely become one of your favorite new things about CSS. Behold, the @supports rule. Also known as Feature Queries. With @supports, you can write a small test in your CSS to see whether or not a particular “feature” (CSS property or value) is supported, and apply a block of code (or no
このエントリでは、Yegor Bugayenkoによる記事、Getters/Setters. Evil. Period.を紹介する。 (Yegorから和訳と転載の許可は得た。) 以下はその全文の和訳だが、意訳超訳が混じっているので、もとのニュアンスを知りたければ元記事を読んでもいいし、読まなくてもいい。 2003年にAllen Holubが書いたWhy getter and setter methods are evilという有名な記事に端を発する古い議論がある。それは、getter/setterはアンチパターンで避けるべきものなのか、 もしくはオブジェクト指向プログラミングに必須なものなのかというもの。 この議論に少しだけ私の意見を加えたいと思う。 上記記事の要旨はこうだ。 getterやsetterはひどい慣習で、これらを使うやつらはゆるせん。誤解の無いようもう一度言うが、 私はget
DigitalOcean provides cloud products for every stage of your journey. Get started with $200 in free credit! Updated on January 12, 2017: Proper support checks are now part of the article body. Added information about the block value. Minor tweaks and copy edits. Enjoy! If you’re a regular reader here at CSS-Tricks, chances are good you know a bit about web fonts. You may even know a few useful tri
written by DEFGHI1977 [重要] auonenetホームページ公開代理サービス終了に伴い、公開済みの各種ドキュメントをxdomainサーバーに移行しました. 旧アドレスへのアクセスは本ページにリダイレクトされます. お手数ですがブックマークやリンクなどのURL参照先の更新・変更をお願いいたします. You were redirected from old "dion(auonenet)" page which had been out of service. Please update URL settings of your bookmarks, links or more. Thank you. 突貫工事で作ったため, 抜けがあるかもしれません. ゲームツール等(game tools) 悪魔城ドラキュラHoD(Castlevania HoD)・アイテム早見表(Cas
Firefox 48 is now available, and with it comes the third browser (after Chrome and Opera) to support an initial feature set of the Web Animations API. With it, Brian Birtles goes into detail why this API is a big deal. A few people have recently asked me why I talk so much about the API but still use CSS animations a lot of the time... so with Firefox's official release, here are some thoughts on
Chrome CanaryでCSSのfont-displayプロパティが使えるようになったそうだ。 font-displayプロパティとはCSSの@font-face中で使うことで、そのウェブフォントがダウンロードされる間テキストがどのようにレンダリングされるかをコントロールするプロパティである。次は仕様から引用。 The font-display descriptor for @font-face determines how a font face is displayed, based on whether and when it is downloaded and ready to use. 適当に訳すると、 @font-faceのfont-deisplayディスクリプタはダウンロードされ利用可能になるなどのタイミングに基づいて、フォントフェイスがどのように表示されるかを決定するも
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く