Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<html>
    <head>
        <title></title>
    </head>
    <body>
            <div ID="header">peoeple</div>
</body>
</html>
 
var cars = [{id:"0", name:"bmw"}, {id:0, name:"honda"}, {id:0, name:"lexus"}];
function assignIds(cars) {
    var i;
    var prefix = 100;
    for(i = 0; i<cars.length; i ++) {
        cars[i]["id"] = function(j) {
            return prefix +j;
        }(i);
    }
    return cars;
}
(function doit() {
    console.log("assigning ids to the cars");
    assignIds(cars);
    console.log(assignIds(cars));
}());
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers