Skip to content

Instantly share code, notes, and snippets.

View dimpu's full-sized avatar
🏠
Working from home

Dimpu Aravind Buddha dimpu

🏠
Working from home
View GitHub Profile
"use strict";
class Avenger{
constructor(){
this.who = 'tony';
}
says(){
setTimeout(()=>{
console.log(this.who+' says Rock and roll');
},1);
"use strict";
//es5 code
var avengers = ['tony','steve','bruce','thor'].filter(function(aven){
return aven != 'thor'
});
console.log(avengers);
//same in es6
let avengers = ['tony','steve','bruce','thor'].filter((aven)=> aven != 'thor' );
console.log(avengers);
class Student extends Person{
constructor(){
/**
* to make sure everthing initiated in parent class
*/
super();
}
}
let p = new Student();
"use strict";
class Person{
/**
* initiate anythin you want here
*/
constructor(){
this._name = 'aravind';
this._age = '25';
}
/**
"use strict";
const PI = 3.41;
PI = 2.3;
"use strict";
let lang = "php";
for(;true;){
let lang = "js";
console.log(lang); //expect js
break;
}
console.log(lang); //expect php
var lang = "php";
for(;true;){
var lang = "js";
console.log(lang); //expect js
break;
}
console.log(lang); //expect php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>Es6 tutorial</title>
<script src="./jspm_packages/system.js" type="text/javascript"></script>
<script src="./config.js" type="text/javascript"></script>
</head>
{
"name": "es6-tutorial",
"version": "1.0.0",
"description": "es6 features ",
"main": "app.js",
"scripts": {
"start":"jspm-server",
"test": "karma test"
},
"jspm": {
{
"name": "fake-name",
"version": "1.0.0",
"description": "A Node.js library to create fake data for you.",
"main": "fake-name.js",
"bin":{
"faker":"fake-name.js"
},
"scripts": {
"test": "mocha test"