// It seems like something happened to these strings
// Can you figure out how to clear up the chaos?
// Write a function that joins these strings together such that they form the following words:
// 'Javascript', 'Countryside', and 'Downtown'
// You might want to apply basic JS string methods such as replace(), split(), slice() etc
function myFunction (a, b) {
b = b.split('').reverse().join ('')
return a.concat(b).replace(/[^a-zA-Z ]/g, '')
}
myFunction('java', 'tpi%rcs') // returns 'javascript'
myFunction('c%ountry', 'edis') // returns 'countryside'
myFunction('down', 'nw%ot') // returns 'downtown'
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter