当前位置:网站首页>Differences between string() and tostring() methods
Differences between string() and tostring() methods
2022-06-13 04:49:00 【Dandan's servant】
String() and toString() It is the most commonly used conversion in our daily life js How to get , I don't try to distinguish the difference when I use it at ordinary times , Today I met the record .
Different 1( Yes undefined and null To deal with )
Use String Method pair undefined and null Handle , The result will be in string form undefined and null, But use toString The method will directly report an error .
Different 2( Binary processing of numeric strings )
toString Method can fill in a parameter , This parameter is a hexadecimal number , for example :
(10).toString(2) ==> '1010'
(10).toString(8) ==> '12'
边栏推荐
- Analysis of scoped attribute principle and depth action selector
- PostgreSQL Guide: Insider exploration (Chapter 7 heap tuples and index only scanning) - Notes
- Go/golang connection to database
- Force deduction 121 questions
- Test question bank and online simulation test for special operation certificate of construction scaffolder (special type of construction work) in 2022
- 2022年氧化工艺操作证考试题库及模拟考试
- [untitled]
- Recommended temporary online image compression tool
- The differences between the four startup modes of activity and the applicable scenarios and the setting methods of the two startup modes
- Go scheduled task cron package usage
猜你喜欢
【JS解决】leedcode 117. 填充每个节点的下一个右侧节点指针 II
PowerShell plus domain add computer module
Crawler scrapy framework learning 1
Design system based on MVC using javeswingjdbc
Must know must know -c language keywords
Embedded hardware: electronic components (1) resistance capacitance inductance
QT client development -- driver loading problem of connecting to MySQL database
Converting MySQL data to PostgreSQL with Navicat
[JS solution] leedcode 117 Populate the next right node pointer II for each node
Several methods of identifying equivalent circuit of circuit drawing
随机推荐
Section 4 - arrays
Force buckle 92 Reverse linked list II
2022年建筑架子工(建筑特殊工种)特种作业证考试题库及在线模拟考试
2022道路运输企业安全生产管理人员操作证考试题库及答案
2022年氧化工艺操作证考试题库及模拟考试
Tita绩效宝:远程一对一面谈的问题
2022氯化工艺操作证考试题库及模拟考试
Section 3 - functions
Li Kou brush question 647 Palindrome substring
PowerShell:因为在此系统上禁止运行脚本,解决方法
shell变量学习笔记
Promise processing JS multithreads get the same processing result after all the results are obtained
It's the Caesar code. (*‘▽‘*)*
Red Treasure Book Reading Notes (continuously updated)
SQL notes
你的一对一会议效率低下,你可以这么做!
E - Lucky Numbers
Crawler scrapy framework learning 2
Analysis of scoped attribute principle and depth action selector
CreateAnonymousThreadX给匿名线程传递参数