Advertisement
Didart

Read Text

Apr 9th, 2022
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function readText(input) {
  2.  
  3.     let index = 0;
  4.     let text = input[index];
  5.     index++;
  6.  
  7.     while (text !== "Stop") {
  8.         console.log(text);
  9.  
  10.         text = input[index];
  11.         index++;
  12.     }
  13. }
  14.  
  15. readText(["Nakov", "SoftUni", "Sofia", "Bulgaria", "SomeText", "Stop", "AfterStop", "Europe", "HelloWorld"])
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement