Answers for "javascript get first word"

2

get first word of string js

let myStr = "Hello World"
let firstWord = myStr.split(" ")[0]
Posted by: Guest on March-14-2021
1

js get words first letter

var str = "Java Script Object Notation";
var matches = str.match(/\b(\w)/g); // ['J','S','O','N']
var acronym = matches.join(''); // JSON

console.log(acronym)
Posted by: Guest on April-12-2020

Code answers related to "javascript get first word"

Code answers related to "Javascript"

Browse Popular Code Answers by Language