当前位置:网站首页>JS string and array methods
JS string and array methods
2022-07-03 05:04:00 【The wind blows and birds fly in the crotch】
JS String method :
indexOf Look back before ( Commonly used lastIndexOf Look backwards
indexOf Has two functions
1. You can detect the position of elements in the array
2. You can detect whether there is this element in the array ( duplicate removal )
charAt understand str[1]
charCodeAt understand
slice Intercept
substr
substring
replace String substitution , It can only be replaced once
split Turn a string into an array Split
toUpperCase Convert to uppercase
toLowerCase Convert to lowercase
JS Array method :
reverse Flip
sort Sort
push Add... From the back
unshift Add... From the front
pop Delete... From the back
shift Remove... From the front
indexOf From front to back string index
lastIndexOf String index from back to front
join,toString Convert to string type , It is recommended to use join
concat Become
slice Intercept ( A large array is only a part of a fragment )
splice Delete
————————————————
Copyright notice : This paper is about CSDN Blogger 「 The wind blows and birds fly in the crotch 」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/m0_66477165/article/details/122608744
边栏推荐
- String matching: find a substring in a string
- Learning record of arouter principle
- First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
- Analysis of proxy usage of ES6 new feature
- Market status and development prospect prediction of the near infrared sensor industry of the global Internet of things in 2022
- Caijing 365 stock internal reference: what's the mystery behind the good father-in-law paying back 50 million?
- MySQL master-slave configuration
- [batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)
- MPM model and ab pressure test
- 1095 cars on campus (30 points)
猜你喜欢

Basic use of Metasploit penetration testing framework

Compile and decompile GCC common instructions
![[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached](/img/95/833f5ec20207ee5d7e6cdfa7208c5e.jpg)
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached

Three representations of signed numbers: original code, inverse code and complement code
![[clock 223] [binary tree] [leetcode high frequency]: 102 Sequence traversal of binary tree](/img/0f/bc8c44aee7a2c9dccac050b1060017.jpg)
[clock 223] [binary tree] [leetcode high frequency]: 102 Sequence traversal of binary tree

5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
![[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa](/img/a9/92059db74ccde03b84c69dfce35b37.jpg)
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa

Automatic voltage rise and fall 5-40v multi string super capacitor charging chip and solution

Thesis reading_ Chinese medical model_ eHealth

Analysis of proxy usage of ES6 new feature
随机推荐
"Niuke brush Verilog" part II Verilog advanced challenge
MediaTek 2023 IC written examination approved in advance (topic)
Review the old and know the new: Notes on Data Science
Maximum continuous sub segment sum (dynamic programming, recursive, recursive)
M1 Pro install redis
[batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)
[tools run SQL blind note]
Day 51 - tree problem
[research materials] the fourth quarter report of the survey of Chinese small and micro entrepreneurs in 2021 - Download attached
leetcode435. Non overlapping interval
Market status and development prospects of the global autonomous marine glider industry in 2022
文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
SSM framework integration
Market status and development prospect prediction of global neutral silicone sealant industry in 2022
Market status and development prospect forecast of global button dropper industry in 2022
1114 family property (25 points)
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached
Market status and development prospect prediction of the global fire alarm sensor industry in 2022
Distinguish between releases and snapshots in nexus private library
Gbase8s unique index and non unique index