javascript most efficient find and replace word from array code example
Example 1: pass array of strings to match in str.replace
const name = 'flavio'
const nameCapitalized = name.charAt(0).toUpperCase() + name.slice(1)
Example 2: pass array of strings to match in str.replace
typeof yourVariable === 'object' && yourVariable !== null