Skip to content

Latest commit

 

History

History
20 lines (19 loc) · 298 Bytes

extra.md

File metadata and controls

20 lines (19 loc) · 298 Bytes

generator function

function newUser(x, y) {
  var user = {
    name: x,
    age: y,
  };
  return user;
}
var iqbal = newUser('Jhum', '24');

constructor function

function newUser(x, y) {
  this.name = x;
  this.age = y;
}
var t = new newUser('Jhum', '24');