split() #233
Replies: 6 comments
-
Posted at 2014-03-22 by BogdanG For me it's ok because you do not have the " separator in the 'HELLO' string so you get the same string as the result. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-22 by DrAzzy No, that's an empty string. A " separator would be '"' (a double quote enclosed in single quotes) Correct behavior is to split a word up into letters like Sacha said - try it in any js console.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-23 by BogdanG https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split Syntax str.split([separator][, limit]) Parameters separator |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-23 by BogdanG So you are right. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-23 by graf Also """ |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-24 by @gfwilliams Thanks - I'll try and get a fix for this in the next version. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-03-22 by Sacha
Sorry Gordon,
Found another bug.
'HELLO'.slpit('');
returns:
=[
"HELLO"
]
Should return:
["H", "E", "L", "L", "O"]
Sacha
Beta Was this translation helpful? Give feedback.
All reactions