Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to convert name to initials in javascript

const fullName = nameString.split(' ');
const initials = fullName.shift().charAt(0) + fullName.pop().charAt(0);
return initials.toUpperCase();
Comment

PREVIOUS NEXT
Code Example
Javascript :: postman response xml json xml2Json 
Javascript :: date masking javascript to not allow / 
Javascript :: javascript queryselector 
Javascript :: Iterate object using ngFor in angular 
Javascript :: javascript fibonacci sequence recursion 
Javascript :: preg_match javascript 
Javascript :: mongoose pagination with total count 
Javascript :: how to delete a letter from a string in javascript 
Javascript :: cypress check element have attribute 
Javascript :: merge objects js 
Javascript :: discord.js v13 if dm 
Javascript :: javascript set input value by id 
Javascript :: tailwind config for nextjs 
Javascript :: react render after data loaded 
Javascript :: repeat an element in array in js 
Javascript :: javascript date format mm/dd/yyyy 
Javascript :: how to use axios get 
Javascript :: how to add checked in javascript 
Javascript :: default Electron icon is used reason=application icon is not set 
Javascript :: detect click outside react component 
Javascript :: js date in two weeks 
Javascript :: what is functional composition 
Javascript :: dropify use 
Javascript :: search datatable vuetify 
Javascript :: remove undefined element from array 
Javascript :: jquery get all inputs in form 
Javascript :: angular automatic typewriter animation 
Javascript :: json_insert mysql 
Javascript :: react native vector icons 
Javascript :: clear element children js 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =