How to extract the first character from a string in Node.js

1 Answer

0 votes
const string = 'node.js';
 
const firstCharacter = string[0];
 
console.log(firstCharacter);
  
  
  
/*
run:
        
n
      
*/

 



answered Mar 13, 2024 by avibootz
...