Method Description
charAt() Returns the character at the specified index.
concat() Combines the text of two strings and returns a new string.
forEach() Calls a function for each element in the array.
indexOf() Returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.
length() Returns the length of the string.
pop() Removes the last element from an array and returns that element.
push() Adds one or more elements to the end of an array and returns the new length of the array.
reverse() Reverses the order of the elements of an array -- the first becomes the last, and the last becomes the first.
sort() Sorts the elements of an array.
substr() Returns the characters in a string beginning at the specified location through the specified number of characters.
toLowerCase() Returns the calling string value converted to lower case.
toString() Returns the string representation of the number's value.
toUpperCase() Returns the calling string value converted to uppercase.
Js Built-in Functions
字符串与数组方法总结
最新推荐文章于 2024-10-20 23:43:47 发布
本文汇总了常用的字符串和数组操作方法,包括字符检索、字符串连接、数组元素遍历及排序等核心功能。介绍了如charAt()、concat()、forEach()、indexOf()等字符串与数组方法的用途。
280

被折叠的 条评论
为什么被折叠?



