Skip to content

Instantly share code, notes, and snippets.

@ShahinAhmed7
Last active March 2, 2018 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShahinAhmed7/b3dc52381155cf4d35c35dbe53132368 to your computer and use it in GitHub Desktop.
Save ShahinAhmed7/b3dc52381155cf4d35c35dbe53132368 to your computer and use it in GitHub Desktop.
ES6-variable// source http://jsbin.com/weganat
<!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
var getData = (temp, cold = 10) => {
if(temp < cold){
return "this is cold here";
} else{
return"this is not so cold";
}
}
console.log(getData(8));
</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
var getData = (temp, cold = 10) => {
if(temp < cold){
return "this is cold here";
} else{
return"this is not so cold";
}
}
console.log(getData(8));</script></body>
</html>
//jshint esnext:true
var getData = (temp, cold = 10) => {
if(temp < cold){
return "this is cold here";
} else{
return"this is not so cold";
}
}
console.log(getData(8));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment