dabidabidesh

wordsUppercase

Sep 17th, 2020
338
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //09. * Words Uppercase
  2. wordsUppercase = (str) => {
  3.   'use-strict'
  4.  
  5.   let pattern = /\w+/g
  6.  
  7.   let result = str.match(pattern)
  8.  
  9.   console.log(result
  10.     .map(a => a.toUpperCase())
  11.     .join(', '))
  12. }
  13.  
  14. wordsUppercase('Hi, how are you?')
RAW Paste Data