array method

1. Arrays : The Basics

Array Overvies
array เป็น type of object , flexible ,list-like , มักจะ transform to number
เป็น built-in properties and method
array example -> []
ใน array สามารถเป็นอะไรก็ได้ เช่น number , booleans , objects
ตัวอย่างเช่น pets array สามารถมีหลาย object eg filter() , sort() , length

Array : properties and methods
lenght , forEach() , sort() , reverse() , find() and findIndex()
include() , every() and some()
push() and pop()
shift() and unshift()

Length property and direct assignment 0.47/2.57
return number of items in array , value return เป็น number
const alphabet = [“a”,”b”,”c”,”d”,”e”]
alphabet.length ==> 5
array[0] = “a”
❈ direct assignment
alphabet[0] = “z” – เป็นการ overriding
const alphabet = [“z” ,”a”,”b”,”c”,”d”,”e”]

Discover more from อรรถพรคลินิก ศัลยกรรมตกแต่ง Attaporn Plastic Surgery clinic 阿塔蓬博士,曼谷整形外科医生

Subscribe now to keep reading and get access to the full archive.

Continue reading