当前位置:网站首页>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 !
边栏推荐
- Material management system based on SSM (source code + document + database)
- Sequential stack traversal binary tree
- [multi thread performance tuning] multi thread lock optimization (Part 1): optimization method of synchronized synchronization lock
- 科创人·味多美CIO胡博:数字化是不流血的革命,正确答案藏在业务的田间地头
- Nodered has no return value after successfully inserting into the database (the request cannot be ended)
- lol手游之任务进度条精准计算
- CVPR 2022 remembers Sun Jian! Tongji and Ali won the best student thesis award, and hekaiming was shortlisted
- Teach you how to cancel computer hibernation
- “拯救”直播带货,一个董宇辉还不够
- Bytebase 加入阿里云 PolarDB 开源数据库社区
猜你喜欢

顺序栈1.0版本

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

2022年最新四川建筑八大员(电气施工员)模拟题库及答案

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

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

Basic concepts and definitions of Graphs

物联网?快来看 Arduino 上云啦

微信小程序中使用vant组件

红象云腾完成与龙蜥操作系统兼容适配,产品运行稳定

实现基于Socket自定义的redis简单客户端
随机推荐
"Super point" in "Meng Hua Lu", is the goose wronged?
全上链哈希游戏dapp系统定制(方案设计)
VMware virtual machine setting static IP
大一女生废话编程爆火!懂不懂编程的看完都拴Q了
Apple doesn't need money, but it has no confidence in its content
lol手游之任务进度条精准计算
二叉树的基本性质与遍历
年轻人捧红的做饭生意经:博主忙卖课带货,机构月入百万
You can capture fingerprints with a mobile camera?! Accuracy comparable to signature and monogram, expert: you are aggravating discrimination
C語言實現掃雷(簡易版)
Some ideas about chaos Engineering
RF_ DC system clock setting gen1/gen2
C language to realize mine sweeping (simple version)
The AI for emotion recognition was "harbouring evil intentions", and Microsoft decided to block it!
gateway
“拯救”直播带货,一个董宇辉还不够
首个大众可用PyTorch版AlphaFold2复现,哥大开源OpenFold,star量破千
物聯網?快來看 Arduino 上雲啦
实现基于Socket自定义的redis简单客户端
Popupwindow touch event transparent transmission scheme