Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js capitalize

const capitalize = s => s && s[0].toUpperCase() + s.slice(1)

// to always return type string event when s may be falsy other than empty-string
const capitalize = s => (s && s[0].toUpperCase() + s.slice(1)) || ""
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #capitalize
ADD COMMENT
Topic
Name
2+3 =