Skip to content

Instantly share code, notes, and snippets.

@joewalker
Created September 15, 2015 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewalker/920bb5c93d95c273d7cf to your computer and use it in GitHub Desktop.
Save joewalker/920bb5c93d95c273d7cf to your computer and use it in GitHub Desktop.
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