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 isObject(value) { | |
| const type = typeof value; | |
| return value != null && type === 'object'; | |
| } | |
| function trackTealium(category, action, label, value, nonInteraction = false) { | |
| let eventData; | |
| if (isObject(category)) { | |
| eventData = category; |
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
| console.log("hello") |
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
| Template.profile.helpers ({ | |
| person : function() { | |
| return People; | |
| } | |
| }); | |
| People = [ | |
| {name: "The Dude",age: "Age is relative, man.", occupation: "abiding"}, | |
| {name: "Bill Murray", age: 63, occupation: "actor"} | |
| ]; |
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
| <template name = "profile"> | |
| <#each person> | |
| <div> | |
| Name : {{ name }} <br> | |
| Age : {{ age }} <br> | |
| Occupation: {{ occupation }} | |
| </div> | |
| </each> | |
| </template> |
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 newArr = [1, 2, 3, 4, 5, 6]; | |
| function binarySearch(searchElement) { | |
| var minIndex = 0; | |
| var maxIndex = this.length - 1; | |
| var currentIndex; | |
| var currentElement; | |
| while (minIndex <= maxIndex) { | |
| currentIndex = Math.round((minIndex + maxIndex) / 2); |
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 Eratosthenes = function (n) { | |
| this.array = function () { | |
| var arr = []; | |
| var output = []; | |
| for (var i = 0; i < n; i++) { | |
| arr.push(i); | |
| } | |
| return arr; | |
| }; |
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
| /*Object Oriented Blackjack | |
| A Game has: Players | |
| Dealer | |
| Deck | |
| A Player / Dealer has: Score | |
| Cards | |
| A Score has: Game Logic |