当前位置:网站首页>Differences between JS valueof and toString
Differences between JS valueof and toString
2022-07-01 09:18:00 【su27_ 0101】
- valueOf Returns the object itself 、
- toString Returns the object description string
obj = new Object(); // {}
obj.toString(); // '[object Object]'
obj.valueOf() == obj // true
toString Is to convert an object into a string ;
valueOf Is to convert an object into a value of basic data
valueOf Biased towards arithmetic ,toString Tend to show .
1、 In object conversion ( for example :alert(a)), Will call... First toString Method , If not rewritten toString Will call valueOf Method , If neither method is overridden , Press Object Of toString Output .
2、 When the string type is forcibly converted, the... Will be called first toString Method , When forced to a number, call... First valueOf.
3、 In the case of arithmetic operators ,valueOf Has a higher priority than toStri
边栏推荐
- laravel postman 提交表单出现419错误。2020年7月6日记。
- Football and basketball game score live broadcast platform source code /app development and construction project
- Niuke monthly race 22- collect pieces of paper
- js valueOf 与 toString 区别
- Phishing identification app
- Shell script -select in loop
- dsPIC30F6014a LCD 方块显示
- Preparing for the Blue Bridge Cup -- bit operation
- Shell script case in statement
- 足球篮球体育比赛比分直播平台源码/app开发建设项目
猜你喜欢

小鸟识别APP

MapReduce编程基础

FAQ | FAQ for building applications for large screen devices
![2.3 [pytorch] data preprocessing torchvision datasets. ImageFolder](/img/19/cce8d8a7cdcb1021166c46adf803c1.png)
2.3 [pytorch] data preprocessing torchvision datasets. ImageFolder

【检测技术课案】简易数显电子秤的设计与制作

队列的实现和应用

Redis——Lettuce连接redis集群
![[pytorch] softmax function](/img/97/b8ae22e8496a77e665d716cb0e9ee3.png)
[pytorch] softmax function

Principles of Microcomputer - internal and external structure of microprocessor

Error org apache. catalina. core. StandardContext. FilterStart start filter exception
随机推荐
韦东山板子编译内核问题解决
类加载
Shell script -read command: read data entered from the keyboard
【ESP 保姆级教程】疯狂毕设篇 —— 案例:基于阿里云、小程序、Arduino的WS2812灯控系统
nacos服务配置和持久化配置
Tree structure -- binary tree 2 non recursive traversal
集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常
Jeecg restart alarm 40001
记一次redis超时
【ESP 保姆级教程 预告】疯狂Node.js服务器篇 ——案例:ESP8266 + MQ系列 + NodeJs本地服务 + MySql存储
Niuke monthly race 22- collect pieces of paper
Reproduced Xray - cve-2017-7921 (unauthorized access by Hikvision)
[pytorch learning] torch device
Shell script -while loop explanation
[ESP nanny level tutorial] crazy completion chapter - Case: chemical environment system detection based on Alibaba cloud and Arduino, supporting nail robot alarm
Databinding source code analysis
OSPF - virtual link details (including configuration commands)
SDN_ Simple summary
[pytorch] 2.4 convolution function nn conv2d
Mysql8.0 learning record 17 -create table