-2

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

I need the guide to Basic JavaScript - Use the parseInt Function (at freecodecamp) enter image description here

  • 2
    What is your question? – Ryan Wilson Jun 01 '18 at 18:56
  • how to solve this one ? – Piyush Basak Jun 01 '18 at 18:59
  • Solve what exactly? – Patrick Hofman Jun 01 '18 at 19:00
  • @PiyushBasak It appears as if you have not declared the function convertToInteger(), as your window shows "convertToInteger is not defined" – Ryan Wilson Jun 01 '18 at 19:00
  • The tutorial is obviously not suited for you (perhaps because it is bad, the way it teaches doesn't fit you, or it is for a more advanced audience). Find yourself a different tutorial. If a tutorial leads to you needing to get spoonfed on stackoverflow, it is probably not the right choice for learning. A proper tutorial should teach you what you need to solve the problems. – ASDFGerte Jun 01 '18 at 19:08
  • @PatrickHofman Why was this question closed as a duplicate, the post you all linked to addresses an issue that the OP is not even asking about, the text about "007" being converted to 7 is a tutorial explaining what parseInt() does. – Ryan Wilson Jun 01 '18 at 19:10
  • parseInt is the worst way to get a number in JS. it's better since es5, but it's still slow. – dandavis Jun 01 '18 at 19:42

1 Answers1

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);
}
Ryan Wilson
  • 10,223
  • 2
  • 21
  • 40
  • @PiyushBasak You're welcome. If you are satisfied with my answer, please mark it as the accepted answer by clicking the check mark. – Ryan Wilson Jun 01 '18 at 19:11
  • is there any community, chat groups like teaming up in Slack where we can collaborate with other students to learn JavaScript ? – Piyush Basak Jun 01 '18 at 19:12
  • @PiyushBasak I'm not sure, but I imagine a Google search should offer up some items if they exist. StackOverflow has a chat portion which you can use to create specific chat rooms. – Ryan Wilson Jun 01 '18 at 19:13