var customer = { name: "Foo" };
var card = { amount: 7, product: "Bar", unitprice: 42 };
var message = "Hello " + customer.name + ",\n" +
"want to buy " + card.amount + " " + card.product + " for\n" +
"a total of " + (card.amount * card.unitprice) + " bucks?";
odds = evens.map(function (v) {
return v + 1;
});
pairs = evens.map(function (v) {
return { even: v, odd: v + 1 };
});
nums = evens.map(function (v, i) {
return v + i;
});
var _this = this
$('.btn').click(function(event){
_this.sendData()
})
function addNumbers (x, y, z) {
if (y === undefined) {
y = 7;
}
if (z === undefined) {
z = 42;
}
return x + y + z;
};
addNumbers(1) === 50;
function Shape (id, x, y) {
this.id = id;
this.move(x, y);
};
Shape.prototype.move = function (x, y) {
this.x = x;
this.y = y;
};