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
/* | |
○ Building blocks for writing modules. | |
○ A façade is a high level interface to a larger code base that hides the underlying code complexity. | |
○ The facade exposes an application programming interface (API) which limits the available functionaity we can use and helps encapsulate a lot of the interior code behavior. | |
Façade Pattern Structure in JavasScript | |
• the function returns an object | |
• the object acts a a façade to the inner implementation , which is encapsulated. | |
*/ |
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 ns; | |
(function (ns) { | |
ns.Car = function (type) { | |
this.speed = 0; | |
this.type = type || "No Type"; | |
} | |
ns.Car.prototype = { | |
drive: function(newSpeed) { | |
this.speed = newSpeed; | |
} |
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
// the prototype object | |
function Hero(type) { | |
//properties of this proto object | |
this.strength = 0; | |
this.type = type || "No type"; | |
} | |
// proto function, used by all | |
Hero.prototype.attack = function(newStrength) { |
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 Car(type) { | |
this.type = type; | |
this.speed = 0; | |
this.func = function() { | |
return this.type; | |
} | |
} | |
var bmw = new Car("BMW"); |
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
// 1. the basic javascript object creation | |
function Car(type) { | |
this.speed = 0; | |
this.type = type || "No type"; | |
this.drive = function(newSpeed) { | |
this.speed = newSpeed; | |
} | |
} | |
var bmw =new Car("BMW"); |
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 Car(type) { | |
this.speed = 0; | |
this.type = type || "No type"; | |
this.drive = function(newSpeed) { | |
this.speed = newSpeed; | |
} | |
} | |
//creating a new instance of the Car object, the bmw. | |
var bmw =new Car("BMW"); |
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
--1. BEGIN transaction, write your query and execute. | |
SELECT * | |
FROM [stuart_sandbox].[dbo].[Categories] | |
BEGIN transaction | |
UPDATE [stuart_sandbox].[dbo].[Categories] | |
SET Description ='Sushi' | |
WHERE CategoryID = '8' | |
--2. Check the results of your query |
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 modelSeries = $('#seriesName').text(); | |
var gradeLevel = $('#gradeLevel').text(); | |
function seriesFormatter (series, grade) { | |
var result = (series.indexOf(grade.toLowerCase()) >= 0) ? series : series + " " + grade; | |
return result; | |
} | |
var str = seriesFormatter(modelSeries, gradeLevel); |
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
p { | |
color: blue; | |
margin: 8px; | |
} | |
b { | |
color: red; | |
} |
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
--wrap the column name with this... | |
SELECT '="' + dealer_code + '"', dealer_name | |
FROM dealers |
NewerOlder