Remove First Indexletter In A String Code Example

Snippet 1

  let str = 'Hello';
 
str = str.substring(1);
console.log(str);
 
/*
    Output: ello
*/
 

Snippet 2

  let str = 'Hello';
 
str = str.slice(1);
console.log(str);
 
/*
    Output: ello
*/
 

Copyright © Code Fetcher 2020

 

 

Published

Leave a comment

Your email address will not be published. Required fields are marked *