-
Notifications
You must be signed in to change notification settings - Fork 0
/
ES6_5.js
38 lines (33 loc) · 1006 Bytes
/
ES6_5.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// let add = (a,b) =>a+b;
// console.log(add(10,20));
// let sqr = (a=1,b=1) =>a*b;
// console.log(sqr(10,5));
// function defaultpar(name,age){
// name?name=name:name='Alamin';
// age?age=age:age=18;
// console.log('Hello '+name+'. I am '+age+' years old');
// }
// console.log(defaultpar('Jayeema',17));
// let defaultpar6 = (name6='Tanvir',age6=18) =>{
// console.log(`I\'m ${name6} and ${age6} years old`);
// }
// console.log(defaultpar6('Asif',12));
// function FunctionConst(name,age){
// name?name=name:name='Alamin';
// age?age=age:age=25;
// this.name=name;
// this.age=age;
// }
// var jayeema = new FunctionConst();
// console.log(jayeema.name);
// console.log(jayeema.age);
// var jayeema = new FunctionConst('Jayeema',19);
// console.log(jayeema.name);
// console.log(jayeema.age);
function FunctionConst6(name='alamin',age=19){
this.name=name;
this.age=age;
}
let jayeema=new FunctionConst6();
console.log(jayeema.name);
console.log(jayeema.age);