<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var a = 789;
console.log(a);
console.log(parseInt(a / 100));//百位
console.log(parseInt(a % 100 / 10));//十位
console.log(a % 10);//个位
</script>
</body>
</html>
10-06
5277
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)