how to rerive a string as an integer code example Example: convert a string into an integer var text = '42px'; var integer = parseInt(text, 10); // returns 42