Silly-Say/WordSplitter.js

8 lines
176 B
JavaScript

"use strict";
function splitWords(sentence) {
// Split the sentence on whitespace and return the resulting array
return sentence.split(/\s+/g);
}
export default splitWords;