当前位置:网站首页>2.13 weekly report
2.13 weekly report
2022-07-06 03:36:00 【m0_ sixty-three million seven hundred and thirteen thousand two】
Built-in objects
Js The language comes with , For developers , Provide necessary functions (Math Array String Date)
Math object ( Not a constructor ):Math.PI PI Math.ceil() Rounding up , That is, take the larger value
Math.round() rounding (.5 special , Take it from the big one ) Math.abs() The absolute value Math.floor() Rounding down , That is, take the small value
Math.random() Returns a random decimal number [0,1)
A random number between two numbers , And include these two numbers
Date object (Date): If there are no parameters , Returns the current time of the system
Common writing of parameters Digital 2019,10,01 String type ‘2019-10-1 8:8:8’
Format date
Get the total number of milliseconds ( distance 1970.1.1)
Countdown cases :
Variable attribute differences
identical : Are used to store data
Different : Variable declaration and assignment Write the variable name directly Exist alone
Attribute in object There is no need to declare When used, it is object . attribute
The difference between function and method
identical : To achieve a function Do something
Different : Functions are declared separately Call function name () Exist alone Method is inside the object Different calls
character string
- String immutable
The inner value remains unchanged , Changing the content is actually changing the address , Memory opens up a memory space
- Return position according to character
str.indexOf(‘ Characters to find ’, The starting position )
- Returns the character according to the position
charAt(index) str.charAt(index) Return character
charCodeAt(index) str.charCodeAt(index) Return character's ASCII code
str[index] Compatibility
- Splice and intercept strings
Splicing : var str= ‘Andy’;
str.concat(‘red’)
Intercept :str.substr(‘ Intercept start position ’,’ Intercept a few characters ’)
- Replace string Convert to array (185)
Replace :str.replace(‘a’,‘b’) hold a Replace with b Just replace one
Convert to array :split(‘ Separator ’) String separator str.split(‘ Separator ’)
- Case study (183 184)
data type
Simple data type ( Basic data type , Value type )
string number Boolean undefined null( For an empty object )
Stack : Opening up space directly puts value
Complex data type ( Reference type ): adopt new Keyword created objects (Object Array Date)
First store the address on the stack ( Hexadecimal ) Then point to the data in the heap
Web APIs
Page interaction function
API:( Application programming interface ) Some predefined functions , Help us realize some function
Web API: It is a set of operating browser functions and page elements provided by the browser API
边栏推荐
- 蓝色样式商城网站页脚代码
- SWC introduction
- Cubemx transplantation punctual atom LCD display routine
- 【SLAM】lidar-camera外参标定(港大MarsLab)无需二维码标定板
- 记录一下逆向任务管理器的过程
- 2.2 fonctionnement stm32 GPIO
- Blue style mall website footer code
- 下一个行业风口:NFT 数字藏品,是机遇还是泡沫?
- Performance test method of bank core business system
- Lua uses require to load the shared library successfully, but the return is Boolean (always true)
猜你喜欢
Precautions for single chip microcomputer anti reverse connection circuit
数据分析——seaborn可视化(笔记自用)
Pytoch foundation - (1) initialization of tensors
Derivation of anti Park transform and anti Clarke transform formulas for motor control
C language circular statement
Pointer written test questions ~ approaching Dachang
Blue style mall website footer code
Mysqldump data backup
教你用Pytorch搭建一个自己的简单的BP神经网络( 以iris数据集为例 )
Containerization Foundation
随机推荐
Erreur de la carte SD "erreur - 110 whilst initialisation de la carte SD
SD卡报错“error -110 whilst initialising SD card
ArabellaCPC 2019(补题)
1. New project
RT thread -- FTP of LwIP (2)
指针笔试题~走近大厂
A brief introduction to symbols and link libraries in C language
出现Permission denied的解决办法(750权限谨慎使用)
Idea push rejected solution
Redis cache breakdown, cache penetration, cache avalanche
An article about liquid template engine
Buuctf question brushing notes - [geek challenge 2019] easysql 1
Cross origin cross domain request
Canvas cut blocks game code
Recommended papers on remote sensing image super-resolution
2. GPIO related operations
Pelosi: Congress will soon have legislation against members' stock speculation
MySQL Server层四个日志
教你用Pytorch搭建一个自己的简单的BP神经网络( 以iris数据集为例 )
SD card reports an error "error -110 whilst initializing SD card