Answers for "get string from character javascript"

14

how to get the first character of a string in javascript

let str = 'John Wick'
let firstChar = str.charAt(0) 
console.log(firstChar); // "J"
Posted by: Guest on November-16-2020
12

javascript get first character of string

var str="Hello Folks!"
var firstStringChar = str.charAt(0); //H
Posted by: Guest on August-01-2019
2

javascript get character from string

// (ES6 / ES2015)+ way of doing it
const str = "Hello World!";
const chars = [...str];

// Pre-ES2015 way of doing it
var chars2 = str.split("");
Posted by: Guest on February-27-2021
0

javascript get character from string

const str = "Hello World";
const firstCharacter = str.charAt(0);
Posted by: Guest on March-02-2021

Code answers related to "get string from character javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language