JSFiddle - React, Tailwind, and code Playground
by rexonms
CSS
https://jsfiddle.net/rexonms/96L1vktn/#
JavaScript
// Chapter 3
console.clear()
const cleaner = v => v
const x = 'xxx'
const sentence = ` Now not sure about ... .. ${x} it &*II and
moret `
const wordsA = sentence.split(/\s|\b/)
const cleanWords = wordsA.filter(cleaner)
console.log(cleanWords)
var identity = v => v
var words = " Now is the time for all... and more". split(/\s|\b/)
console.log(words)
console.log(words.filter( identity ))
var output = (msg, formatFn = identity) => {
msg = formatFn( msg )
console.log(msg)
}
var upper = (txt) => txt.toUpperCase()
output("Hello World", upper)
output("Hello")
// Array Destructuring
const arr = ['one', 'two', 'three']
const [ one, two, three ] = arr