Last active
September 11, 2015 17:57
-
-
Save sandeshdamkondwar/f1580a06efb4542ba185 to your computer and use it in GitHub Desktop.
Future of javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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