What is Join() in jQuery?

后端 未结 6 1379
无人及你
无人及你 2020-12-08 18:14

What is Join() in jquery? for example:

var newText = $(\"p\").text().split(\" \").join(\" \"); 
6条回答
  •  离开以前
    2020-12-08 18:44

    That's not a jQuery function - it's the regular Array.join function.

    It converts an array to a string, putting the argument between each element.

提交回复
热议问题