Created
March 3, 2018 14:25
-
-
Save ShahinAhmed7/063ea7805956c77e3bac75b03e1a9a8f to your computer and use it in GitHub Desktop.
let < variable// source http://jsbin.com/zunaqar
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://fb.me/react-with-addons-0.14.0.js"></script> | |
<script src="http://fb.me/react-dom-0.14.0.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id=example></div> | |
<h1>Hello world</h1> | |
<script id="jsbin-javascript"> | |
//jshint esnext:true | |
class Driver { | |
constructor(name){ | |
this._name = name; | |
} | |
get myname(){ | |
return this._name; | |
} | |
set myname(val){ | |
if(val.length > 6){ | |
this._name = val; | |
} | |
} | |
} | |
let drive = new Driver('John'); | |
console.log(drive.myname); | |
drive.myname = 'JohnyJohn', | |
console.log(drive.myname); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//fb.me/react-with-addons-0.14.0.js"><\/script> | |
<script src="//fb.me/react-dom-0.14.0.js"><\/script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id=example></div> | |
<h1>Hello world</h1> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
//jshint esnext:true | |
class Driver { | |
constructor(name){ | |
this._name = name; | |
} | |
get myname(){ | |
return this._name; | |
} | |
set myname(val){ | |
if(val.length > 6){ | |
this._name = val; | |
} | |
} | |
} | |
let drive = new Driver('John'); | |
console.log(drive.myname); | |
drive.myname = 'JohnyJohn', | |
console.log(drive.myname); | |
</script></body> | |
</html> |
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
//jshint esnext:true | |
class Driver { | |
constructor(name){ | |
this._name = name; | |
} | |
get myname(){ | |
return this._name; | |
} | |
set myname(val){ | |
if(val.length > 6){ | |
this._name = val; | |
} | |
} | |
} | |
let drive = new Driver('John'); | |
console.log(drive.myname); | |
drive.myname = 'JohnyJohn', | |
console.log(drive.myname); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment