当前位置:网站首页>The JS method parameter passed a number beginning with 0. A magical problem occurred and bothered me for a long time
The JS method parameter passed a number beginning with 0. A magical problem occurred and bothered me for a long time
2022-06-24 20:34:00 【zhanyd】
Today I came across a magical problem , Make a special note of , It's very simple , Blame me for being too young ...
Here's the thing , One js Method to pass in a number , There is no problem at ordinary times , A simple example :
// Defined function
function logNum(num) {
console.log(num)
}
// Call function
logNum(123)
Output results :123

That's no problem, right ?
Today I passed in a special number :0123, Something magical happened :
How to become 83 了 ???
Does this figure have a special meaning ? It can't be said like that ?
Try another number :
It's hard to understand !
later , Finally I found the same problem on the Internet :
The answers are as follows :
original 0 The first number is octal !
Use octal calculator to calculate 0123 Converting to decimal is really 83 Well !
Empathy , Hexadecimal numbers are in 0x At the beginning :
I'm so young !
边栏推荐
- 科技抗疫: 运营商网络洞察和实践白皮书 | 云享书库NO.20推荐
- [cann document express issue 04] unveiling the development of shengteng cann operator
- Bytebase 加入阿里云 PolarDB 开源数据库社区
- 顺序栈遍历二叉树
- 图的基本概念以及相关定义
- Using dynamic time warping (DTW) to solve the similarity measurement of time series and the similarity identification analysis of pollution concentration in upstream and downstream rivers
- 华为云ModelArts第四次蝉联中国机器学习公有云服务市场第一!
- 图像PANR
- Leetcode(455)——分发饼干
- [cann document express issue 05] let you know what operators are
猜你喜欢

Dongyuhui is not enough to bring goods to "rescue" live broadcast

The four stages of cloud computing development have finally been clarified

两位湖南老乡,联手干出一个百亿IPO

顺序栈遍历二叉树

"Super point" in "Meng Hua Lu", is the goose wronged?

海泰前沿技术|隐私计算技术在医疗数据保护中的应用

"Ningwang" was sold and bought at the same time, and Hillhouse capital has cashed in billions by "selling high and absorbing low"

Sequence stack version 1.0

使用gorm查询数据库时reflect: reflect.flag.mustBeAssignable using unaddressable value
![[video tutorial] functions that need to be turned off in win10 system. How to turn off the privacy option in win10 computer](/img/14/0313857adc178ecee4c866a05e54aa.jpg)
[video tutorial] functions that need to be turned off in win10 system. How to turn off the privacy option in win10 computer
随机推荐
Map跟object 的区别
顺序表的基本操作
史上最全DPU厂商大盘点(上)
First understand redis' data structure - string
Popupwindow touch event transparent transmission scheme
It is said that Tencent officially announced the establishment of "XR" department to bet on yuanuniverse; Former CEO of Google: the United States is about to lose the chip competition. We should let T
京东一面:Redis 如何实现库存扣减操作?如何防止商品被超卖?
"Ningwang" was sold and bought at the same time, and Hillhouse capital has cashed in billions by "selling high and absorbing low"
用自身细胞作为原料,首例3D打印耳朵移植成功!未来可打印更复杂器官
"Super point" in "Meng Hua Lu", is the goose wronged?
Redis installation of CentOS system under Linux, adding, querying, deleting, and querying all keys
宅男救不了元宇宙
Jd.com: how does redis implement inventory deduction? How to prevent oversold?
IDEA Dashboard
Leetcode(455)——分发饼干
图的基本概念以及相关定义
[cann document express issue 04] unveiling the development of shengteng cann operator
Unit actual combat lol skill release range
RF_ DC system clock setting gen1/gen2
[cloud resident co creation] ModelBox draws your own painting across the air