当前位置:网站首页>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 !
边栏推荐
- Huawei cloud modelarts has ranked first in China's machine learning public cloud service market for the fourth time!
- 顺序表的基本操作
- 消息称腾讯正式宣布成立“XR”部门,押注元宇宙;谷歌前 CEO:美国即将输掉芯片竞争,要让台积电、三星建更多工厂...
- Bytebase加入阿里云PolarDB开源数据库社区
- [普通物理] 光栅衍射
- 红象云腾完成与龙蜥操作系统兼容适配,产品运行稳定
- 天天鉴宝暴雷背后:拖欠数千万、APP停摆,创始人预谋跑路?
- Leetcode(135)——分发糖果
- 16 excellent business process management tools
- 【云驻共创】ModelBox隔空作画 绘制你的专属画作
猜你喜欢

The latest simulated question bank and answers of the eight members (Electrical constructors) of Sichuan architecture in 2022
![[performance tuning basics] performance tuning strategy](/img/83/be41a6a0c5c186d3fb3a120043c53f.jpg)
[performance tuning basics] performance tuning strategy

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

苹果不差钱,但做内容“没底气”

Bytebase rejoint la communauté de base de données open source d'alicloud polardb

物联网?快来看 Arduino 上云啦

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

虚拟化是什么意思?包含哪些技术?与私有云有什么区别?

Map跟object 的区别

宅男救不了元宇宙
随机推荐
苹果不差钱,但做内容“没底气”
畅直播|针对直播痛点的关键技术解析
顺序栈遍历二叉树
CVPR 2022缅怀孙剑!同济、阿里获最佳学生论文奖,何恺明入围
基于QT+MySQL的相机租赁管理系统
网络安全审查办公室对知网启动网络安全审查,称其“掌握大量重要数据及敏感信息”
Nodered has no return value after successfully inserting into the database (the request cannot be ended)
The four stages of cloud computing development have finally been clarified
[cann document express issue 06] first knowledge of tbe DSL operator development
Some ideas about chaos Engineering
Difference between map and object
在Dialog中使用透明的【X】叉叉按钮图片
What is showcase? What should showcase pay attention to?
Stackoverflow 年度报告 2022:开发者最喜爱的数据库是什么?
C語言實現掃雷(簡易版)
[video tutorial] functions that need to be turned off in win10 system. How to turn off the privacy option in win10 computer
Teach you how to cancel computer hibernation
红象云腾完成与龙蜥操作系统兼容适配,产品运行稳定
16个优秀业务流程管理工具
Sequential stack traversal binary tree