Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
   <head>
      <meta name="description" content="Using the $.map() utility function" />
      <meta charset="utf-8">
      <title>jQuery in Action, third edition</title>
   </head>
   <body>
      <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
   </body>
</html>
 
var strings = ['1', '2', '3', '4', 'S', '6'];
var values = $.map(strings, function(value){
  var result = Number(value);
  return isNaN(result) ? null : result;
});
$.each(values, function(i, value) {
    console.log(value.toString());
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
AurelioDeRosapro
0viewers