Skip to content
Node.js Sounds Complicated? This Article Makes It Click

Edit It: Split the given string at whitespaces and limit the returned array to one item only

Home>split() JavaScript String Method>Edit It: Split the given string at whitespaces and limit the returned array to one item only

Edit It: Split the given string at whitespaces and limit the returned array to one item only

This code shows how to split a string at whitespaces and limit the returned array to one item only.

See it on StackBlitz