How to check string starts with https in JavaScript

1 Answer

0 votes
let str = "https://www.seek4info.com";

if (str.startsWith('https') ) {
    console.log("yes"); 
} else {
    console.log("no"); 
}

 
            
  
/*
run:
    
yes
      
*/

 



answered May 24, 2024 by avibootz
...