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
var b = new QueryBuilder(); | |
var select = b.Select(columns: "id, name, price", from: "products", as: "p"); | |
var select2 = b.Select(columns: "id, discount, name", from: "sales", as: "s"); | |
b.Join(left: select, right: select2, on: new { s: "productId", p: "Id", operation: Operations.Equals }); | |
//or | |
b.LeftOuterJoin(left: select, right: select2, on: new { s: "productId", operation: Operations.Equals, p: "Id }); | |
select.Where(column: "name", operation: Operations.Equals, value: "josh"); |
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
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
// Code | |
function(container) { | |
var index; | |
function log(){ | |
console.log(index); |
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
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
// Code | |
function(container) { | |
var index; | |
function log(){ | |
console.log(index); |
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
// taken from http://www.dreamincode.net/code/snippet154.htm | |
// | |
// Find the weaknesses, and clean up the code. | |
// Find at least 3 things you can make better! | |
// | |
// Test numbers (return true): | |
// 4111111111111111 | |
// 378282246310005 | |
// 5555555555554444 |
NewerOlder