当前位置:网站首页>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
边栏推荐
猜你喜欢
Python implementation of maddpg - (1) openai maddpg environment configuration
数据分析——seaborn可视化(笔记自用)
ESBuild & SWC浅谈: 新一代构建工具
1. New project
Schnuka: visual positioning system working principle of visual positioning system
three. JS page background animation liquid JS special effect
3.1 detailed explanation of rtthread serial port device (V1)
MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置
Derivation of anti Park transform and anti Clarke transform formulas for motor control
【SLAM】lidar-camera外参标定(港大MarsLab)无需二维码标定板
随机推荐
ESBuild & SWC浅谈: 新一代构建工具
Recommended papers on remote sensing image super-resolution
How to choose PLC and MCU?
Pytorch load data
Derivation of anti Park transform and anti Clarke transform formulas for motor control
2.2 STM32 GPIO操作
【Qt5】Qt QWidget立刻出现并消失
SWC introduction
Record the process of reverse task manager
给新人工程师组员的建议
Some problem records of AGP gradle
Pytorch基础——(1)张量(tensor)的初始化
Analyze menu analysis
2. GPIO related operations
Overview of OCR character recognition methods
Force buckle 1189 Maximum number of "balloons"
施努卡:3d视觉检测应用行业 机器视觉3d检测
深度解析指针与数组笔试题
Deno介绍
svg拖动点裁剪图片js特效