str to arr

Run Settings
LanguageJavaScript
Language Version
Run Command
/* console.log("Hello World!");Write a function to split a string and convert it into an array of words. Examples (Input ==> Output): "Robin Singh" ==> ["Robin", "Singh"] "I love arrays they are my favorite" ==> ["I", "love", "arrays", "they", "are", "m */ // codewars 8kyu // with function biasa function myFunction(a) { return a.split(' '); } console.log(myFunction("I love arrays they are my favorite")) // with arrow function const myFunction = a => a.split(' ') console.log(myFunction("I love arrays they are my favorite"))
Editor Settings
Theme
Key bindings
Full width
Lines