Advertisement
Tugamars_PT

Untitled

Jul 22nd, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. const taskInstructions = ['Fix a bug and something something remote', 'Must push the new version to the cloud'];
  2. const actualTask = 'Fix a bug and push the new version to the remote';
  3.  
  4. let titm = taskInstructions;
  5. let stm = actualTask.split(" ");
  6.  
  7. let f = "";
  8.  
  9. let i=0;
  10.  
  11. for(let key in stm){
  12.  
  13. for(let k in titm){
  14. let search=titm[k].search(stm[key]);
  15. if(search != -1){
  16.  
  17. f = f + stm[key] + " ";
  18. titm[k]=titm[k].replace( stm[key], "" );
  19. }
  20.  
  21. }
  22. i++;
  23. }
  24.  
  25. if(i==stm.length){
  26. console.log(titm);
  27. console.log(f);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement