Skip to content

Instantly share code, notes, and snippets.

@satoyuichi
Last active May 22, 2017 05:16
Show Gist options
  • Save satoyuichi/2b85ae6e1389a2641d2b253db80565fa to your computer and use it in GitHub Desktop.
Save satoyuichi/2b85ae6e1389a2641d2b253db80565fa to your computer and use it in GitHub Desktop.
str の中身を一文字ずつ出力するプログラム
// str の中身を一文字ずつ出力するプログラムを書きなさい
// ex) h
// o
// g
// ...
// o
// ヒント) P57, P69, P92, P96
let str = 'hogepiyo';
// for (let i = 0; i < 8; i++) {
// console.log (str[i]);
// }
// for (let elem of str) {
// console.log (elem);
// }
for (let i = 0; str[i] != undefined; i++) {
console.log (str[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment