需要使用parseInt函数的指南

时间:2018-06-01 18:54:18

标签: javascript parseint

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function/

我需要Basic JavaScript指南 - 使用parseInt函数(在freecodecamp上)enter image description here

1 个答案:

答案 0 :(得分:0)

//You need to declare the function convertToInteger taking a string parameter
//To declare a function, use the function key word and pass in your string parameter
function convertToInteger(str){
     return parseInt(str);
}