ChefSteps interview question

Write a function that given a string number returns the int representation of it

Interview Answers

Anonymous

26 Nov 2014

Start with a sum of zero. For each character is the string multiply sum by 10 and then convert it to an int and add to sum.

Anonymous

27 Apr 2016

Write a function? If it's JavaScript you can just use parseInt() and be done.