How I can get this
array = ["apple", "orange kiwi", "lemon"];
to this
array["apple", "orange", "kiwi", "lemon"];
split array row in multiple keys if there is space in it.
tnx
-
1Careful with the vocabulary used here. The keys in an array are the numbers used to access values. It would probably be best to speak of splitting entries or rows with spaces in them, but not keys.Domino– Domino2015年11月30日 13:44:35 +00:00Commented Nov 30, 2015 at 13:44
1 Answer 1
Join and split?
array = ["apple", "orange kiwi", "lemon"];
array = array.join(" ").split(" ");
answered Nov 30, 2015 at 13:35
Alex K.
177k32 gold badges276 silver badges299 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js