Skip to content

Instantly share code, notes, and snippets.

@sandeshdamkondwar
Last active September 11, 2015 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandeshdamkondwar/f1580a06efb4542ba185 to your computer and use it in GitHub Desktop.
Save sandeshdamkondwar/f1580a06efb4542ba185 to your computer and use it in GitHub Desktop.
Future of javascript
class Coupon {
constructor(options) {
this.title = options.title;
this.desc = options.desc;
this.code = options.code;
this.link = options.link;
this.expiry = options.expiry;
}
}
class OnlineCoupon extends Coupon {
constructor(options) {
super(options);
this.merchantLandingURL = options.merchantLandingURL;
}
}
class RestaurantCoupon extends Coupon {
constructor(options) {
super(options);
this.phone = options.phone;
this.timings = options.timings;
this.outlets = options.outlets;
}
}
var foodpandaCoupon = new OnlineCoupon({
title: "Flat 33% Off on Rs. 450+ (All Users)",
desc: "Get flat 33% discount on orders of Rs. 450 and above. Maximum discount value is Rs. 150. Offer valid on online payments only.",
code: "CDAUPUSH",
link: "http://www.coupondunia.in/foodpanda/flat-33-percent-off-on-orders-all-users-108693",
expiry: "1441993991672",
merchantLandingURL: "https://www.foodpanda.in/"
});
console.log(foodpandaCoupon);
Object.observe(object, function(changeRecords) {
changeRecords.forEach(function(cr) {
console.log(cr.name + ' ' + cr.type);
});
});
object.a = 1; // a add
object.a = 1; // prints nothing in console
object.b = 1; // b add
delete object.a ; // a delete
(function () {
"use strict";
let fname = 'sandesh';
let lname = 'damkondwar';
console.log(`${fname}` + ` ` + `${lname}`); // "sandesh damkondwar"
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment