Anonymous user
Split a character string based on change of character: Difference between revisions
Split a character string based on change of character (view source)
Revision as of 03:58, 17 March 2019
, 5 years ago→{{header|Jsish}} refactor the ternary and augmented assignment
(Add Jsish) |
|||
Line 833:
var result = last;
for (var pos = 1; pos < str.length; pos++) {
result += ((last == str[pos]) ?
last = str[pos];
}
|