int cating javascript

JavaScript
var stringNumber = '21'; //string
var castedNumber = parseInt(stringNumber) //integer
Source

Also in JavaScript: