当前位置:网站首页>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 !
边栏推荐
- 科创人·味多美CIO胡博:数字化是不流血的革命,正确答案藏在业务的田间地头
- Compressed list of redis data structures
- Leetcode(135)——分发糖果
- Open programmable infrastructure (OPI) project, redefining dpu/ipu
- [performance tuning basics] performance tuning standards
- Bytebase加入阿里云PolarDB开源数据库社区
- 用自身细胞作为原料,首例3D打印耳朵移植成功!未来可打印更复杂器官
- 消息称腾讯正式宣布成立“XR”部门,押注元宇宙;谷歌前 CEO:美国即将输掉芯片竞争,要让台积电、三星建更多工厂...
- 2022年最新四川建筑八大员(电气施工员)模拟题库及答案
- 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
猜你喜欢

Material management system based on SSM (source code + document + database)

Byte and Tencent have also come to an end. How fragrant is this business of "making 30million yuan a month"?

物聯網?快來看 Arduino 上雲啦

Behind Tiantian Jianbao storm: tens of millions in arrears, APP shutdown, and the founder's premeditated plan to run away?

16个优秀业务流程管理工具

云计算发展的 4 个阶段,终于有人讲明白了

Design of routing service for multi Activity Architecture Design

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

顺序栈遍历二叉树

Cooking business experience of young people: bloggers are busy selling classes and bringing goods, and the organization earns millions a month
随机推荐
基于QT+MySQL的相机租赁管理系统
JVM tuning
两位湖南老乡,联手干出一个百亿IPO
2022年最新四川建筑八大员(电气施工员)模拟题库及答案
开放可编程基础设施(OPI)项目,重新定义DPU/IPU
Accurate calculation of task progress bar of lol mobile game
Material management system based on SSM (source code + document + database)
Popupwindow touch event transparent transmission scheme
【CANN文档速递05期】一文让您了解什么是算子
物联网?快来看 Arduino 上云啦
等等党们的胜利!挖矿退潮后,显卡价格全面暴跌
You can capture fingerprints with a mobile camera?! Accuracy comparable to signature and monogram, expert: you are aggravating discrimination
C langage pour le déminage (version simplifiée)
微信小程序中使用vant组件
VMware virtual machine setting static IP
二叉树的基本性质与遍历
Q1: error in JMeter filename must not be null or empty
苹果、微软、谷歌不再掐架,今年要合力干一件大事
Set up your own website (14)
实现基于Socket自定义的redis简单客户端