สุดท้ายดัชนีของตารางคู่ลำดับ

รหัสตัวอย่าง

27
0

จาวาสคริปต์ได้เมื่อรายการที่อยู่ในตารางคู่ลำดับ

var colors = ["red","blue","green"];
var green = colors[colors.length - 1]; //get last item in the array
0
0

สุดท้ายดัชนีของจาวาสคริปต์


var str = "Please locate where 'locate' occurs!";

var ind1 = str.indexOf("locate"); // return location of first value which founded
var ind2 = str.lastIndexOf("locate"); // return location of last value which founded
var ind3 = str.indexOf("locate", 15); // start search from location 15 and then take first value which founded
var ind4 = str.search("locate");
//The search() method cannot take a second start position argument. 
//The indexOf() method cannot take powerful search values (regular expressions).

document.write("<br>" + "Length of string:", len);
document.write("<br>" + "indexOf:", ind1);
document.write("<br>" + "index of last:", ind2);
document.write("<br>" + "indexOf with start point:", ind3);
document.write("<br>" + "search:", ind4);
0
0

สุดท้ายดัชนีของตารางคู่ลำดับ js

array.lastIndexOf(searchElement[, fromIndex]);

หน้าคล้ายกัน

คล้ายกันหน้ากับตัวอย่าง

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังหน้ากับตัวอย่างอยู่ในหมวดหมู่