Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Javascript reverse string, one index
//JavaScript-C24.2.0 (SpiderMonkey) function reverse(s){ var a = s.split('') var b = 0, e = s.length - 1 for(; b < e; ++b, --e){ [a[b], a[e]] = [a[e], a[b]] } return a.join("") } function reversei(s){ var a = s.split('') var l = s.length - 1 for(i = 0; i < l / 2; ++i){ [a[i], a[l - i]] = [a[l - i], a[i]]; } return a.join("") } print(reversei("пепелац"))
run
|
edit
|
history
|
help
0
BinaryGap, javascript - Find longest sequence of zeros in binary representation of an integer.
Copy of "Javascript is Weird"
merge json array objects based on ID
Animal categories
BF.JS
AVL-GO-FLAT
2k Dreamin
LazyListJS
Just stop thinking about it and go eat
Animal category