var year=prompt("请输入你的出生年份");
var age=2022-year;
alert('你今年'+age+'岁')
11-02
4355
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-01
979
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-31
1425
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-06
1515
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-31