Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript get first letter of each word

var msg = "Name Surname a"
var acronym = msg.match(/(w)/g).join('');

console.log(acronym)
Comment

get first word of string js

let myStr = "Hello World"
let firstWord = myStr.split(" ")[0]
Comment

get the first word of a string javascript

let sentence = "The big brown fox"
let word = sentence.split(" ")[0]

console.log(word) // The
Comment

js get first letter of string

var x = 'some string';
alert(x.charAt(0)); // alerts 's'
Comment

get first word in javascript

let string = "Hello World"

let firstWord = typeof string.split(" ")[0] !== 'undefined' ? string.split(" ")[0] : null; 
Comment

js get words first letter

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

console.log(acronym)
Comment

PREVIOUS NEXT
Code Example
Javascript :: node js ffmpeg image to video 
Javascript :: get the value of css pseudo properties js 
Javascript :: date difference moment js 
Javascript :: java script login system 
Javascript :: Javascript Show HTML Elements 
Javascript :: js debouncing 
Javascript :: Remove First and Last Character 
Javascript :: jQuery get background image url of element 
Javascript :: react native grid view 
Javascript :: javascript fromEntries 
Javascript :: cubic root javascript 
Javascript :: nextjs The engine "node" is incompatible with this module. 
Javascript :: angular new component 
Javascript :: ng model on change 
Javascript :: scroll to element in scrollable div 
Javascript :: select a particular sibling jquey 
Javascript :: time complexity javascript 
Javascript :: base64 nodejs image 
Javascript :: get minutes and seconds from seconds in js 
Javascript :: how to get type of variable in javascript 
Javascript :: status code json 
Javascript :: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 
Javascript :: call ajax after ajax 
Javascript :: change array of object to object without index value 
Javascript :: check / unchecked a checkbox with jQuery 
Javascript :: js seconds to time 
Javascript :: deep copy in angular 12 
Javascript :: regex quantifiers 
Javascript :: jquery get element tag 
Javascript :: react hook example 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =