Skip to content

Instantly share code, notes, and snippets.

@sicongzhao
Last active July 23, 2016 16:34
Show Gist options
  • Save sicongzhao/d7943514540666330bfbc70d49c50016 to your computer and use it in GitHub Desktop.
Save sicongzhao/d7943514540666330bfbc70d49c50016 to your computer and use it in GitHub Desktop.
issues-to-be-solved-in-codeCampus

Requirement to evaluate javascript code

  • variables initializatoin
  • regex: operator, escape sequence, space, bracket notation
  • variables' type & value
  • function call
  • get the error message
    try {
        eval(code); 
    } catch (e) {
        if (e instanceof SyntaxError) {
            alert(e.message);
        }
    }
  • print the object
    JSON.stringify(myArray)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment