Created
May 22, 2017 05:52
-
-
Save satoyuichi/c02b44ec145ee9b327d84efbba62d9fc to your computer and use it in GitHub Desktop.
str から 'o'(オー) の個数を数えて出力するプログラム
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// str から 'o'(オー) の個数を数えて出力するプログラムを書き Gist を使って #phh_2017_yuichi チャンネルで共有しなさい | |
// ex) 2 個 | |
let str = 'hogepiyopiyo'; | |
let count = 0; | |
for (let elem of str) { | |
if (elem === 'o') { | |
count++; | |
} | |
} | |
console.log (count + ' 個'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment