search

Home  >  Q&A  >  body text

slice() omits the end index and selects the last element by default

$("li").slice(1).css("border","1px solid red"); //This works

$("li").slice(1,) .css("border","1px solid red");//This will report an error and has no effect

半圈不直会旋转的爱~半圈不直会旋转的爱~2415 days ago1656

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2018-06-07 15:21:03

    What is the extra comma for?

    reply
    0
  • 半圈不直会旋转的爱~

    I saw that the second way of writing in the video was to add a comma, but it had no effect when I used it ~ so I changed to the first way.

    半圈不直会旋转的爱~ · 2018-06-07 18:55:07
  • Cancelreply