Created
January 12, 2020 22:46
-
-
Save suntong/8fc6f099d39e32514b3c6c8406a6568b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/cubarot
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function getCoordinates(element) { | |
let x, y, z; | |
// X: { x, y, z } = { 1, 2, 3 } | |
x = 1 | |
y = 2 | |
z = 3 | |
// do stuff to get coordinates | |
return [x, y, z]; | |
} | |
{ | |
const [x, y, z] = getCoordinates(); | |
console.log(x, y, z) | |
} | |
function getXYZ() { | |
let x, y, z; | |
// X: { x, y, z } = { 1, 2, 3 } | |
x = 1 | |
y = 2 | |
z = 3 | |
// do stuff to get coordinates | |
return {x:x, y:y, z:z}; | |
} | |
{ | |
const {x, y, z} = getXYZ(); | |
console.log(x, y, z) | |
} | |
{ | |
const {x, y1, z} = getXYZ(); | |
console.log(x, y1, z) | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function getCoordinates(element) { | |
let x, y, z; | |
// X: { x, y, z } = { 1, 2, 3 } | |
x = 1 | |
y = 2 | |
z = 3 | |
// do stuff to get coordinates | |
return [x, y, z]; | |
} | |
{ | |
const [x, y, z] = getCoordinates(); | |
console.log(x, y, z) | |
} | |
function getXYZ() { | |
let x, y, z; | |
// X: { x, y, z } = { 1, 2, 3 } | |
x = 1 | |
y = 2 | |
z = 3 | |
// do stuff to get coordinates | |
return {x:x, y:y, z:z}; | |
} | |
{ | |
const {x, y, z} = getXYZ(); | |
console.log(x, y, z) | |
} | |
{ | |
const {x, y1, z} = getXYZ(); | |
console.log(x, y1, z) | |
} | |
</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
function getCoordinates(element) { | |
let x, y, z; | |
// X: { x, y, z } = { 1, 2, 3 } | |
x = 1 | |
y = 2 | |
z = 3 | |
// do stuff to get coordinates | |
return [x, y, z]; | |
} | |
{ | |
const [x, y, z] = getCoordinates(); | |
console.log(x, y, z) | |
} | |
function getXYZ() { | |
let x, y, z; | |
// X: { x, y, z } = { 1, 2, 3 } | |
x = 1 | |
y = 2 | |
z = 3 | |
// do stuff to get coordinates | |
return {x:x, y:y, z:z}; | |
} | |
{ | |
const {x, y, z} = getXYZ(); | |
console.log(x, y, z) | |
} | |
{ | |
const {x, y1, z} = getXYZ(); | |
console.log(x, y1, z) | |
} |
Author
suntong
commented
Jan 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment