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
let brackets = { | |
"[": "]", | |
"{": "}", | |
"(": ")", | |
"<": ">" | |
} | |
function correctBrackets (str) { | |
const vals = Object.keys(brackets).map(key => brackets[key]); | |
const keys = Object.keys(brackets); |
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
"use strict"; | |
var events = Symbol("events"); | |
function MyObserver () { | |
this[events] = {}; | |
} | |
MyObserver.prototype = {}; |
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
function doubleNum (number) { | |
var string = number.toString(); | |
var length = string.length; | |
var left = string.substr(0, length / 2); | |
var right = string.substr(length / 2, length); | |
if (left === right) { return number; } | |
return number * 2; | |
} |
NewerOlder