Skip to content

Instantly share code, notes, and snippets.

@AFelipeTrujillo
Created August 18, 2015 14:26
Show Gist options
  • Save AFelipeTrujillo/4f81bb94f1c915c0be81 to your computer and use it in GitHub Desktop.
Save AFelipeTrujillo/4f81bb94f1c915c0be81 to your computer and use it in GitHub Desktop.
To parse an integer in javascript with jQuery
var sNum = "12314";
var num = parseInt(sNum.match(/\d+/)[0]);
console.log(num);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment