Created
August 25, 2018 05:34
-
-
Save mojaray2k/763ae58b647ee71d6616dd42ff04d639 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/diqumox
This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
// Using E5 appraoch | |
var es5Device_Id = 4; | |
var es5Guid = 20; | |
var es5UserName = "hello"; | |
var es5Data = '{"device_id":"' + es5Device_Id + '","guid"' + es5Guid + '","username":"' + es5UserName + '","}'; | |
console.log(es5Data); | |
// Using ES6 approach | |
const es6Device_Id = 4; | |
const es6Guid = 20; | |
const es6UserName = "hello"; | |
const es6Data = `{"device_id":"${es6Device_Id}","guid": "${es6Guid}","username":"${es6UserName}"}`; | |
console.log(es6Data); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// Using E5 appraoch | |
var es5Device_Id = 4; | |
var es5Guid = 20; | |
var es5UserName = "hello"; | |
var es5Data = '{"device_id":"' + es5Device_Id + '","guid"' + es5Guid + '","username":"' + es5UserName + '","}'; | |
console.log(es5Data); | |
// Using ES6 approach | |
const es6Device_Id = 4; | |
const es6Guid = 20; | |
const es6UserName = "hello"; | |
const es6Data = `{"device_id":"${es6Device_Id}","guid": "${es6Guid}","username":"${es6UserName}"}`; | |
console.log(es6Data); | |
</script></body> | |
</html> |
This file contains hidden or 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
// Using E5 appraoch | |
var es5Device_Id = 4; | |
var es5Guid = 20; | |
var es5UserName = "hello"; | |
var es5Data = '{"device_id":"' + es5Device_Id + '","guid"' + es5Guid + '","username":"' + es5UserName + '","}'; | |
console.log(es5Data); | |
// Using ES6 approach | |
const es6Device_Id = 4; | |
const es6Guid = 20; | |
const es6UserName = "hello"; | |
const es6Data = `{"device_id":"${es6Device_Id}","guid": "${es6Guid}","username":"${es6UserName}"}`; | |
console.log(es6Data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment