Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var JavaScriptReserved = map[string]bool{ "break": true, "case": true, "comment": true, "continue": true, "default": true, "delete": true, "do": true, "else": true, "export": true, "for": true, "function": true, "if": true, "import": true, "in": true, "label": true, "new": true, "return": true, "switch": true, "this": true, "var": true, "void": true, "while": true, "with": true, "catch": true, "class": true, "const": true, "debugger": true, "enum": true, "extends": true, "finally": true, "super": true, "throw": true, "try": true, "alert": true, "confirm": true, "open": true, "print": true, "NaN": true, "Date": true, "constructor": true, "assign": true, "location": true, "Location": true, "window": true, "Window": true, "abstract": true, "boolean": true, "byte": true, "char": true, "double": true, "false": true, "final": true, "float": true, "goto": true, "implements": true, "instanceof": true, "int": true, "interface": true, "long": true, "native": true, "null": true, "package": true, "private": true, "protected": true, "public": true, "short": true, "static": true, "synchronized": true, "throws": true, "transient": true, "true": true, }
Reserved JavaScript keywords
Functions ¶
func JavaScriptify ¶
JavaScriptify, based on Goify makes a valid JavaScript identifier out of any string. It does that by removing any non letter and non digit character and by making sure the first character is a letter or "_". JavaScriptify produces a "CamelCase" version of the string, if firstUpper is true the first character of the identifier is uppercase otherwise it's lowercase.