Functional Programming: Split a String into an Array Using the split Method


What is the reason why this regex is not working. It should capture every word and exclude some puntuaction signs.
Tell us what’s happening:

Your code so far


function splitify(str) {
// Only change code below this line

let splitified =str.split(/W/);

console.log(splitified)
// Only change code above this line
}
splitify("Hello World,I-am code");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36.

Challenge: Split a String into an Array Using the split Method

Link to the challenge:

It is done. Thanks!
function splitify(str) {
// Only change code below this line

let splitified =str.split(/W/);

console.log(splitified)
// Only change code above this line
}
splitify(“Hello World,I-am code”);