問題です。 問題: 呼び出すたびに、1,2,3,...を返すような関数 f( )を定義せよ。 f(); // 1 f(); // 2 f(); // 3 この問題、解けますでしょうか? 普通の関数では、できないと思います。 しかし「クロージャ」というのを使えば、このようなことができます。 クロージャって何だ? 「クロージャ」という言葉を、プログラムの本やサイトで目にすることがありますよね。 私が最初に見たのは続・初めてのPerl 改訂版(アルパカ本)でした。 まったく理解できませんでした。 その後、404 Blog not foundやnaoyaさんのブログなどで「クロージャ」という単語を目にしました。 やはり、まったく分かりませんでした。 とどめの一撃はWikipediaの解説記事。 クロージャ (クロージャー、Closure) は、プログラミング言語において引数以外の変数を実行時の環境
従来のWebアプリケーションとSPAの違いに着目し、Spring Boot × Vue.jsでSPAを作る際のポイントやハマりどころを紹介します。
Since discovering grids, OOCSS and the like I’ve found writing CSS far easier, but perhaps more importantly, writing CSS that makes sense. Harry Roberts said in his Big CSS talk that we should defer more work to the HTML, using more classes in the markup to make a site easier to maintain for developers. I really subscribe to this idea, however, I have found that having loads of classes pilled in t
Over a year ago I published the original 12 Little-known CSS Facts and, to this day, it has been one of SitePoint’s most popular articles ever. Since that post was published, I’ve been collecting more little CSS tips and tidbits for a new post. Because we all know that every successful movie should spawn a cheesy sequel, right? Artwork by SitePoint/Natalia Balska. So let’s get right into this year
An in-depth article on how to style the contents of the SVG <use> element and overcome some challenges it brings. One of the most common use cases for SVG graphics is icon systems, and one of the most commonly-used SVG spriting techniques is one that uses the SVG <use> element to “instantiate” the icons anywhere they are needed in a document. Instantiating icons or any other SVG element or image u
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く