追記: 10/11 ハテブでバズっているようで、色々指摘があったので追記 getElement*は動作が早いのでIDやクラス名が自明の場合はgetElement*を使う方がいいと言う意見もあり、また、ページの表示で大量に呼び出されるわけではないからボトルネックにはならないと言う意見もある。 getElement*で返されるオブジェクトは動的な変化に対応しており、querySelector*は動的な変化に対応していないため、場合によってはgetElement*を使うといい。このサイトで遊んでみよう。 https://ja.javascript.info/searching-elements-dom#ref-263 for await ... ofは非推奨なので Promise.allを現代的な書き方にした 顧客先のブラウザが古い場合も考慮して、あえてレガシーな書き方もする場合があるらしい。現
Jeff Atwood / 青木靖 訳 2007年2月26日 レジナルド・ブレイスウェイトが書いていることを読んだとき、私はそんなわけないだろうと思っていた。 私と同様、この著者は、プログラミングの仕事への応募者200人中199人はコードがまったく書けないということで苦労している。繰り返すが、彼らはどんなコードも書けないのだ。 彼が引用している著者というのはイムランのことで、彼は単純なプログラムも書けないプログラマをたくさん追い払っているということだ。 かなりの試行錯誤の末に、コードを書こうともがいている人たちというのは、単に大きな問題に対して苦労しているのではないことがわかった。やや小さな問題(連結リストを実装するというような)に対して苦労するということでさえない。彼らはまったくちっぽけな問題に苦労しているのだ。 それで、そういった類の開発者を見分けるための質問を作り始め、私が「Fizz
words = ['Japanese', 'English', 'French'] for w in words: print (w) # 結果 Japanese English French 同じ処理を繰り返すので「ループ処理」とも言われます。ではなぜloopじゃなくて、forなのか?と思いますよね。おれもそう思い、3年くらい経過していました。 ちなみに、別でwhile文もループ処理になります。 ちなみに、使い分けとしては、 for文: 繰り返し回数を指定したい処理 while文: とにかく条件ごとに値を処理 という使い分けができそうです。 本題:for文は如何にしてforなのか。 そろそろ本題に入りましょう。 なぜ、for文はforでループ処理なのか? 調べてみました。 そもそも、ループ処理の種類の表し方は? ループ処理では、whileやforがあることはご存知の通りかもしれませんが、
いぐぞー!! ✈️ 旅するプログラマー @igz0 俺「クソ!! 納期までコードが完成しない!!!」 謎の備忘録おじさん「エラーが発生したので備忘録として書いておきます」 Stack Overflow「これを試して!!」 謎中国人のブログ「動くコードはこれ」 謎のインド人の解説動画「なるべく分かりやすく解説したよ!!」 ワイ「みんな……!!?」 2023-08-12 12:06:47 いぐぞー ✈️ 旅するプログラマー @igz0 旅とプログラミングをこよなく愛します。 アメリカ大陸🇺🇸を横断しました!!小学生からプログラミング→新卒SIer→Webに目覚め個人事業主兼会社員。テレビ出演経験あり。 Webサービスを作りました。AI・VRに没頭中。IT関連中心にツイートします!!アイコンは@ixy先生より利用許諾済み。Amazonアソシエイト。 note.com/igz0/
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く