Home  >  Q&A  >  body text

javascript - 数组reverse()后再join()的问题?

为什么数组在reverse()后再join()后有两种情况?

var x=['l','o','v','e']
x.reverse().join();   // 'e,v,o,l'
x.reverse().join('')  // 'love'

这是什么原因?

PHPzPHPz2769 days ago659

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 01:20:13

    javascript - What is the problem with array reverse() and then join()? - PHP Chinese website Q&A -javascript - What is the problem with array reverse() and then join()? - PHP Chinese website Q&A

    Take a look around Oh, study it.

    reply
    0
  • 怪我咯

    怪我咯2017-04-10 13:13:29



    reply
    0
  • Cancelreply