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
| "use strict"; | |
| class Card { | |
| constructor(cardCode) { | |
| const faceValues = {'J': 11, 'Q': 12, 'K': 13, 'A': 14}; // Face cards to numeric value dictionary | |
| //Set internal card variables containing individual card properties | |
| this.cardCode = cardCode; // Sets Card Code | |
| this.suit = cardCode.slice(-1); // Sets Suit | |
| this.face = cardCode.slice(0, cardCode.length - 1); // Sets Value |
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
| "use strict"; | |
| function isItEqual(obj_1, obj2) { | |
| //Hacky one-liner solution, works in most cases but not if Object has custom ordering | |
| //return JSON.stringify(obj_1) === JSON.stringify(obj2); | |
| //Proper recursive solution: | |
| if(typeof(obj_1) !== typeof(obj2)) { return false; } // Check if obj_1 and obj2 are of different types | |
| if(typeof obj_1 === 'object' && typeof obj2 === 'object') { //Check for Object | |
| if(obj_1 && obj2 && (Object.keys(obj_1).length !== Object.keys(obj2).length)) { return false; } //If obj_1 and obj2 are valid, Check for number of keys in both obj_1 and obj2 |
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
| "use strict"; | |
| function isItEqual(obj_1, obj2) { | |
| //Hacky one-liner solution, works in most cases but not if Object has custom ordering | |
| //return JSON.stringify(obj_1) === JSON.stringify(obj2); | |
| //Proper recursive solution: | |
| if(typeof(obj_1) !== typeof(obj2)) { return false; } // Check if obj_1 and obj2 are of different types | |
| if(typeof obj_1 === 'object' && typeof obj2 === 'object') { //Check for Object | |
| if(obj_1 && obj2 && (Object.keys(obj_1).length !== Object.keys(obj2).length)) return false; //If obj_1 and obj2 are valid, Check for number of keys in both obj_1 and obj2 |
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
| /** | |
| * Created by jsonmartin on 6/27/16. | |
| */ | |
| "use strict"; | |
| function digitsToNumbers(inputStr) { | |
| if(!inputStr) return []; // Edge case handling, catches for empty inputStr | |
| const digitMaps = { | |
| '2': ['A', 'B', 'C'], |
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
| /** | |
| * Created by jsonmartin on 6/27/16. | |
| */ | |
| "use strict"; | |
| function digitsToNumbers(inputStr) { | |
| if(!inputStr) return []; // Edge case handling, catches for empty inputStr | |
| const digitMaps = { | |
| '2': ['A', 'B', 'C'], |
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
| class Animal { | |
| constructor(name, voice = "says") { | |
| this._name = name; | |
| this._voice = voice; | |
| } | |
| speak(phrase) { | |
| return `${this._name} ${this._voice} ${phrase}.`; | |
| } | |
| } |
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
| /** | |
| Last chair standing: 31 | |
| Chair removal order: [1,3,6,10,15,21,28,36,45,55,66,78,91,8,26,44,63,83,5,32,57,82,13,43,74,9,47,81,23,64,4,53,97,51,99,59,17,73,37,96,69,39,14,87,68,50,35,27,20,18,19,25,34,49,67,86,12,54,88,38,84,46,100,77,61,48,41,52,65,85,16,71,24,93,80,89,98,40,94,75,76,7,62,58,90,56,72,33,92,2,11,29,70,22,79,95,30,42,60] | |
| */ | |
| const NUM_CHAIRS = 100 | |
| // Each chair is a member item of a doubly linked list, where each chair is linked to the one before & after itself | |
| class Chair { | |
| constructor(number) { |
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
| /** | |
| Last chair standing: 31 | |
| Chair removal order: [1,3,6,10,15,21,28,36,45,55,66,78,91,8,26,44,63,83,5,32,57,82,13,43,74,9,47,81,23,64,4,53,97,51,99,59,17,73,37,96,69,39,14,87,68,50,35,27,20,18,19,25,34,49,67,86,12,54,88,38,84,46,100,77,61,48,41,52,65,85,16,71,24,93,80,89,98,40,94,75,76,7,62,58,90,56,72,33,92,2,11,29,70,22,79,95,30,42,60] | |
| */ | |
| const NUM_CHAIRS = 100 | |
| // Each chair is a member item of a Doubly Linked List, where each chair is linked to the one before & after itself | |
| class Chair { | |
| constructor(number) { |
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
| /** | |
| Last chair standing: 31 | |
| Chair removal order: [1,3,6,10,15,21,28,36,45,55,66,78,91,8,26,44,63,83,5,32,57,82,13,43,74,9,47,81,23,64,4,53,97,51,99,59,17,73,37,96,69,39,14,87,68,50,35,27,20,18,19,25,34,49,67,86,12,54,88,38,84,46,100,77,61,48,41,52,65,85,16,71,24,93,80,89,98,40,94,75,76,7,62,58,90,56,72,33,92,2,11,29,70,22,79,95,30,42,60] | |
| */ | |
| const NUM_CHAIRS = 100 | |
| // Each chair is a member of a Doubly Linked List, where every chair has a reference to the one before & after itself | |
| class Chair { | |
| constructor(number) { |
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
| <!-- Video ad includes START --> | |
| <script src="https://www.popsugar.com/static/sugar-videojs-player/vendor/jquery.ba-throttle-debounce.js"></script> | |
| <link href="https://vjs.zencdn.net/5.20.2/video-js.min.css" rel="stylesheet"> | |
| <script src="https://vjs.zencdn.net/5.20.2/video.min.js"></script> | |
| <link rel="stylesheet" href="https://www.popsugar.com/static/sugar-videojs-player/vendor/videojs-ima/videojs.ima.css"> | |
| <link rel="stylesheet" href="https://www.popsugar.com/static/sugar-videojs-player/vendor/videojs-ima/videojs.ads.css"> | |
| <style> | |
| /* Video ad CSS fix for Twinning */ | |
| #video-ad-player-container { |
OlderNewer