Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

capitalize first carater js

const capitalize = (s) => {
  if (typeof s !== 'string') return ''
  return s.charAt(0).toUpperCase() + s.slice(1)
}

capitalize('flavio') //'Flavio'
capitalize('f')      //'F'
capitalize(0)        //''
capitalize({})       //''
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #capitalize #carater #js
ADD COMMENT
Topic
Name
3+5 =