Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readText(input) {
- let counter = 0;
- while (input[counter] !== "Stop"){
- console.log(input[counter]);
- counter++;
- }
- }
- Друго решение с фор цикъл:
- function readText(input) {
- for (let i = 0; i <= Number.MAX_VALUE; i++) {
- if (input[i] === "Stop") {
- break;
- }
- console.log(input[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement