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
public class Penguin { | |
private String name; | |
private int id; | |
public Penguin(String myName, int myid) { | |
name = myName; | |
id = myid; | |
} | |
public void eat(){ | |
System.out.println(name+"正在吃"); | |
} |
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
const p = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve(); | |
}, 1000); | |
}); | |
p.then(() => console.log(3)).then(() => console.log(4)); | |
p.then(() => console.log(1)); | |
p.then(() => console.log(2)); |
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 NETSCAPE-Bookmark-file-1> | |
<!-- This is an automatically generated file. | |
It will be read and overwritten. | |
DO NOT EDIT! --> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<TITLE>Bookmarks</TITLE> | |
<H1>Bookmarks</H1> | |
<DL><p> | |
<DT><H3 ADD_DATE="1561344241" LAST_MODIFIED="1561390726" PERSONAL_TOOLBAR_FOLDER="true">书签栏</H3> | |
<DL><p> |
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
{ | |
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", | |
"editor.fontSize": 19, | |
"editor.tabSize": 2, | |
"workbench.statusBar.feedback.visible": false, | |
"window.menuBarVisibility": "default", | |
"workbench.sideBar.location": "left", | |
"telemetry.enableTelemetry": false, | |
"files.insertFinalNewline": true, | |
"files.associations": { |
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
<div class="container"> | |
<div class="left">left</div> | |
<div class="middle"> | |
测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试 | |
</div> | |
<div class="right">right</div> | |
</div> |
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
const nums = [2, 7, 11, 15], | |
target = 9 | |
/** | |
* 二分查值 | |
* | |
* @param {Array} arr the data | |
* @param {nubmer} left the start index | |
* @param {number} right the end index | |
* @param {number} val the target value |
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
const arr = Array.from({ length: 5 }).map((v, i) => i + 1) | |
console.log(arr) | |
Array.prototype.mul = function() { | |
return [...this, ...this.map(v => v * v)] | |
} | |
console.log(arr.mul(), arr) |
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
let func = (a, b, c) => { | |
return 1 | |
} | |
Reflect.ownKeys(func).forEach(k => { | |
console.log(k, func[k]) | |
}) | |
// length 3 | |
// name func |