Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var harmonyFunc=s => s;
- alert(harmonyFunc(2));
- var harmonyFunc2=() => 'Welcome to the Matrix,Neo';
- alert(harmonyFunc2());
- //These lyrics found themselves on Mozilla Developer Network from a Maroon5 Song
- var a=["We're up all night 'till the sun",
- "We're up all night to get some",
- "We're up all night for good fun",
- "We're up all night to get lucky"
- ];
- //defining an anonymous inner function...
- var harmonyFunc3=a.map(s=>s.length);
- alert(JSON.stringify(harmonyFunc3));
- var PersonOriginal=function()
- {
- this.age=0;
- setInterval(()=>{
- if(this.age<24)
- {
- console.log(age);
- this.age++;//this refers to person
- }
- },1000);
- }
- //cannot create constructors using the harmony functional notation
- //something to remember when you are creating brand new objects...this
- //is because it does not have a sense of this...evil smiley face
- var Person=() => {
- this.age=0;
- setInterval(()=>{
- if(this.age<24)
- {
- console.log(age);
- this.age++;//this refers to person
- }
- },1000);
- }
- var p=new Person();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement