翻转字符串算法(JavaScript)
问题:
实战翻转字符串算法
可以先把字符串转化成数组,再借助数组的reverse方法翻转数组顺序,然后把数组转化成字符串。
要求:
结果必须得是一个字符串
解答:
function reverseString(str) { return str.split('').reverse().join(""); } reverseString("hello");
链接:
相关推荐
湾区人工智能 2020-11-20
Pokemogo 2020-11-16
baijingjing 2020-11-16
baijingjing 2020-11-15
Site 2020-11-07
lwnylslwnyls 2020-11-06
justaipanda 2020-11-05
MachineIntellect 2020-11-02
xueyuediana 2020-10-30
GeraldJones 2020-10-30
Tips 2020-10-29
baijingjing 2020-10-28
baijingjing 2020-10-27
硕鼠 2020-10-26
playoffs 2020-10-26
scuyxi 2020-10-25
playoffs 2020-10-25
yise001 2020-10-23