KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have phrase with two words: var phrase = "hello world" and I want to split and assign like in: var words = phrase.split(" "); var word1 = words[0]; var word2 = words[1]; Is there a easier way than this three lines? [updated] I looking to a way for do it in a single line, like: var word1 word2 = phrase.split(" "); is it possible?
Tags (comma-separated)
Save Edits
Cancel