Advertisement
Marin171

JSS

Feb 19th, 2023
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. function chatLogger(input) {
  2. let chat = [];
  3. let numCommand = input.shift().split(" ");
  4.  
  5. for(let i = 0; i < numCommand.length; i++) {
  6. while(numCommand !== "end") {
  7. numCommand++;
  8. switch(numCommand) {
  9. case "Chat": `${Hello}`; break;
  10. case "Chat": `${darling}`; break;
  11. case "Edit": `${darling} ${Darling}`; break;
  12. case "Spam": `${how} ${are} ${you}`; break;
  13. case "Delete": `${Darling}`; break;
  14. default: break;
  15. }
  16. break;
  17. }
  18. command = input.shift();
  19. }
  20. console.log(chat.join(" "));
  21. }
  22. chatLogger([
  23. "Chat Hello",
  24. "Chat darling",
  25. "Edit darling Darling",
  26. "Spam how are you",
  27. "Delete Darling",
  28. "end"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement