javascript中是否有内置函数可以根据总数反转数字?如果没有如何实施?
IE
number = 2;
total_number = 10;
__________________
answer = 9;
reverse(2, 10) // returns 9
自从:
1 == 10
[2 == 9]
3 == 8
4 == 7
5 == 6
6 == 5
7 == 4
8 == 3
9 == 2
10 == 1
javascript中是否有内置函数可以根据总数反转数字?如果没有如何实施?
IE
number = 2;
total_number = 10;
__________________
answer = 9;
reverse(2, 10) // returns 9
自从:
1 == 10
[2 == 9]
3 == 8
4 == 7
5 == 6
6 == 5
7 == 4
8 == 3
9 == 2
10 == 1