Created
September 15, 2015 15:05
-
-
Save joewalker/920bb5c93d95c273d7cf to your computer and use it in GitHub Desktop.
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 trim(value) { | |
return value.replace(/\[\]/g, '').replace(/\{\}/g, '').replace(/\(\)/g, ''); | |
} | |
function braces(value) { | |
while (true) { | |
var newValue = trim(value); | |
if (value === newValue) { | |
return (value === '' ? 'YES' : 'NO'); | |
} | |
value = newValue; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment