How to check if a string starts with another string in Node.js

1 Answer

0 votes
const s = "node.js php c++ c";
   
if (s.startsWith("node"))
    console.log("yes");
else
    console.log("no");
  
     
     
     
     
/*
run:
      
yes
      
*/

 



answered Jan 22, 2022 by avibootz

Related questions

...