当前位置:网站首页>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
边栏推荐
- SAP ALV cell level set color
- Crawler of explanation and application of agency theory
- 3.1 rtthread 串口设备(V1)详解
- Edcircles: a real time circle detector with a false detection control translation
- Pytoch foundation - (2) mathematical operation of tensor
- MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置
- Overview of OCR character recognition methods
- 2. GPIO related operations
- Schnuka: what is visual positioning system and how to position it
- Safety science to | travel, you must read a guide
猜你喜欢
EDCircles: A real-time circle detector with a false detection control 翻译
Mysqldump data backup
Schnuka: 3D vision detection application industry machine vision 3D detection
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
JS音乐在线播放插件vsPlayAudio.js
C language judgment, ternary operation and switch statement usage
How to do function test well
Esbuild & SWC: a new generation of construction tools
Derivation of anti Park transform and anti Clarke transform formulas for motor control
记录一下逆向任务管理器的过程
随机推荐
暑期刷题-Day3
SWC introduction
SAP ALV cell level set color
Handwriting database client
Pytorch基础——(1)张量(tensor)的初始化
How to do function test well
Idea push rejected solution
Princeton University, Peking University & UIUC | offline reinforcement learning with realizability and single strategy concentration
C language circular statement
Canvas cut blocks game code
MPLS experiment
three. JS page background animation liquid JS special effect
Pelosi: Congress will soon have legislation against members' stock speculation
深度解析指针与数组笔试题
[slam] orb-slam3 parsing - track () (3)
Arabellacpc 2019 (supplementary question)
3.2 detailed explanation of rtthread serial port device (V2)
Performance test method of bank core business system
Getting started with applet cloud development - getting user search content
1. New project