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
| stateVariations = db.StateVariations.ToArray(); | |
| // do any filtering on items other than state here, before pulling into memory | |
| translations = db.Translations.Filter(…).ToArray(); | |
| joinedData = translations.GroupJoin( | |
| stateVariations, | |
| translation => translation.Id, | |
| variation => variation.SystemLanguageTranslationId, | |
| (translation, variation) => new { translation, variations = variation }) | |
| .Select(x => new CombinedDataObject |
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
| Db.Translations.GroupJoin( | |
| db.StateVariations, | |
| translation => translation.Id, | |
| variation => variation.TranslationId, | |
| (translation, variation) => new { translation, variations = variation }) | |
| .Select(x => new CombinedDataObject | |
| { | |
| Id = x.translation.Id, | |
| EN = x.translation.EN, | |
| Variations = Mapper(x.variations), |
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 score = 40; | |
| score /= 2; // score is now 20 |
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 price = 50; | |
| price *= 2; // price is now 100 |
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 total = 100; | |
| total -= 20; // total is now 80 |
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 count = 0; count += 5; | |
| // count is now 5 |
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 message = 'Learning Assignment Statements'; | |
| const appName = 'Angular Adventures'; | |
| // message can change, but appName is constant. |
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
| interface User { | |
| name: string; | |
| age: number; | |
| } | |
| let user: User = { name: "Alice", age: 30 }; | |
| function displayUser(user: User): void { | |
| console.log(user.name + " is " + user.age + " years old."); | |
| } |
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 user = { name: "Alice", age: 30 }; | |
| function displayUser(user) { | |
| console.log(user.name + " is " + user.age + " years old."); | |
| } | |
| displayUser(user); // Output: Alice is 30 years old. |
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 greet(name: string): string { | |
| return "Hello, " + name; | |
| } | |
| console.log(greet("Alice")); // Output: Hello, Alice | |
| console.log(greet(123)); // Error: Argument of type 'number' is not assignable to parameter of type 'string'. |