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
function get_obj(){ | |
var obj={ | |
func:function(){ | |
console.log("Tehc"); | |
} | |
}; | |
return obj; | |
} | |
var a = get_obj(); | |
a.func(); |
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
<html> | |
<head> | |
<title>Kode</title> | |
</head> | |
<body> | |
<canvas id="c" width="200" height="200"> | |
</canvas> | |
<script> | |
var g2d = document.getElementById('c').getContext('2d'); |
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> | |
<!-- | |
Created on Dec 9, 2020 at 2:53 PM -0800 | |
https://github.com/911992 | |
--> | |
<html> | |
<head> | |
<title>TODO supply a title</title> | |
<meta charset="UTF-8"> |
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> | |
<!-- | |
Created on Dec 9, 2020 at 2:53 PM -0800 | |
https://github.com/911992 | |
--> | |
<html> | |
<head> | |
<title>TODO supply a title</title> | |
<meta charset="UTF-8"> |
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
var a={a:0,b:0}; | |
var b={a:0,b:0}; | |
var c={}; | |
var d= a; | |
Object.assign(c,a); | |
console.log("a == b "+(a==b)); // false as b has different ptr than a | |
console.log("a == c "+(a==c)); // false as c has its ptr too | |
console.log("a == d "+(a==d)); // trueas the d is athe ptr referencing to the a | |
console.log("b == c "+(c==b)); // false |
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
var arr = [1,9,4,1,00,5,333,222]; | |
arr.sort(function(a,b){ | |
var _a=Number(a); | |
var _b=Number(b); | |
return _a - _b; | |
}); | |
console.log(arr); | |
/* | |
out: |
OlderNewer