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 getVowels(str) { | |
| var numberOfVowels = 0; | |
| var strArray = str.split(''); | |
| for (var i = 0; i < strArray.length; i++ ) { | |
| switch(strArray[i]) { | |
| case 'a': | |
| numberOfVowels++; |
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 createEvenArray(highNum) { | |
| var array = []; | |
| for(var i = highNum; i > 0; i-=2) { | |
| array.unshift(i); | |
| } | |
| console.log(array); | |
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
| // Warmup Enemy generator | |
| function getRandomInt(min, max) { | |
| return Math.floor(Math.random() * (max - min + 1)) + min; | |
| } | |
| var Enemy = function() { | |
| var self = this; |
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
| <!DOCTYPE html> | |
| <html ng-app="mainApp"> | |
| <head> | |
| <title>Angular Setup</title> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
| </head> | |
| <body ng-controller="mainController"> | |
| <div class="jumbotron"> |
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 Party = function(name) { | |
| var self = this; | |
| this.name = name; | |
| this.population = 1000000; | |
| this.getAttacked = function(nuke) { | |
| self.population -= nuke.impact; | |
| if(self.population <= 0) { | |
| self.population = 0; | |
| } |
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 namesArray = ['angela', 'troy', 'ana', 'mark', 'amit', 'peter', 'john', 'gary', 'melissa', 'jacob']; | |
| var dontCall = function(name) { | |
| console.log('Not calling ' + name); | |
| }; | |
| var call = function(name) { | |
| console.log('Calling ' + name); | |
| }; |
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 Dictionary = function() { | |
| var self = this; | |
| var words = [] | |
| this.acceptWord = true; | |
| this.addWord = function(word, def) { | |
| words.push({ | |
| reference: word.toLowerCase(), |
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
| <!DOCTYPE html> | |
| <html ng-app="mainApp"> | |
| <head> | |
| <title>Angular Site</title> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script> | |
| </head> | |
| <body> | |
| <section ng-controller="sumController"> | |
| <h2> {{ sumValue }} (Added Value) </h2> |
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 readlineSync = require('readline-sync'); | |
| var name = readlineSync.question('Hey stranger, what is your name?: '); | |
| var wildAdventure = function() { | |
| var self = this; | |
| var enemies = ['White Walker', 'White Orc', 'Wild Dragon']; | |
| var enemy; | |
| var randomEnemy = function() { | |
| return Math.floor(Math.random() * ((enemies.length - 1) - 0 + 1)) + 0; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| </head> | |
| <body ng-app="myApp" ng-controller="mainController"> | |
| <p>Add an item</p> |
OlderNewer