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
| "emmet.triggerExpansionOnTab": true, | |
| "emmet.includeLanguages": { | |
| "vue-html": "html", | |
| "vue": "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
| "emmet.triggerExpansionOnTab": true, | |
| "emmet.syntaxProfiles": { | |
| "vue": "pug sass" | |
| }, | |
| "emmet.includeLanguages": { | |
| "vue": "pug" | |
| } |
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 fun1() { | |
| console.log("fun1 start!"); | |
| } | |
| function fun2() { | |
| console.log("fun2 start!"); | |
| fun1(); | |
| } | |
| function fun3() { |
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
| const attName = 'name'; | |
| let person = { | |
| name: 'Harry', | |
| age: 22 | |
| } | |
| console.log(person[name]); // Harry | |
| console.log(person.name); // Harry |
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
| const attName = 'name'; | |
| let person = { | |
| attName: 'Harry', | |
| age: 22 | |
| } | |
| console.log(person[attName]); // undefined | |
| // 這樣寫的話等同於 物件[屬性名] | |
| console.log(person['attName']); // Harry |
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
| const attName = 'name'; | |
| let person = { | |
| [attName]: 'Harry', | |
| age: 22 | |
| } | |
| console.log(person[attName]); // Harry |
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
| const classMates = ["Harry", "John", "Tom", "Mary", "Jerry"]; | |
| let classMatesList = {} | |
| classMates.forEach((name, id) => { | |
| classMatesList = {...classMatesList, ['Id' + ++id]: name} | |
| }) | |
| console.log(classMatesList); | |
| // { Id1: "Harry", Id2: "John", Id3: "Tom", Id4: "Mary", Id5: "Jerry" } |
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
| let person = { | |
| name: 'Harry', | |
| age: 22 | |
| } | |
| let clonePerson = person; | |
| person.name = 'John'; | |
| console.log(clonePerson.name); // 'John' |
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
| let stringA = "This is a string"; | |
| let stringB = stringA; | |
| stringA = "The string has changed"; | |
| console.log(stringA); //The string has changed | |
| console.log(stringB); //This is a string | |
| console.log(stringA === stringB); //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
| string name = employee.getName(); | |
| customer.setName("mike"); | |
| if (paycheck.isPosted()) { | |
| // ... | |
| } |
OlderNewer