this.students.forEach(student => alert(this.title + ': ' + student))
function MyObjectClass() {}
MyObjectClass.prototype = {
method: function() {
console.log.apply(null, arguments);
}
}
var first_object = new MyObjectClass();
first_object.method('some arguments');
// some arguments
MyObjectClass.prototype.method = function() {
console.log('Initial method is overriden');
}
first_object.method('some arguments');
// Initial method is overriden
offsetX and offsetY are relative to the parent container, whereas pageX and pageY are relative to the document
if ( car.modification ) {
for (var modification of global_modifications_list) {
if (car.modification[ modification ]) {
// do something
}
}
}