Skip to content

美圖倉庫

又一個WordPress站點

Menu
  • 示例页面
Menu

js splice

Posted on 2021年8月21日2021年8月21日 by root

//刪除位置2前面的元素,加入元素

var arr = new Array(6)
arr[0] = “George”
arr[1] = “John”
arr[2] = “Thomas”
arr[3] = “James”
arr[4] = “Adrew”
arr[5] = “Martin”

document.write(arr + “
“)
//刪除位置2前面的元素,加入元素
arr.splice(2,0,”William”)

document.write(arr + “
“)


定義和用法

slice() 方法可從已有的數組中返回選定的元素。
語法

arrayObject.slice(start,end)

發佈留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

近期文章

  • 使用 httpd 容器反向代理 host 网络模式的 vnstat 容器:实战与配置总结
  • Racknerd AMD Ryzen Windows VPS 推荐
  • ipv6 list
  • openmediavault(6.0) acme get Let’s encrypt SSL certificate for dynu ddns
  • Using Let’s Encrypt Certification for Synology Nas Systems With dynu as DDNS Provider and auto-renew it (updated 5-26-23)

近期评论

  1. 「一位WordPress评论者」於〈世界,您好!〉發佈留言
© 2025 美圖倉庫 | Powered by Superbs Personal Blog theme