Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> 
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  </head>
  
<body> 
  
</body> 
</html>
 
function transform(array) {
  b = [];
  var i;
     for (i = 0; i < array.length; i += 1) {
        b[i] = (function (x) { 
          return function () { return x; };
        })(array[i]);
     }
  return b;
}
alert(transform([23,25]));
alert(transform([23,25])[0]());
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers