download:The core principles of JavaScriptCode specifications usually include the following aspects:
Naming rules for variables and functions whitespace, indentation, and comments. Other common specifications… The canonical code is easier to read and maintain.
Code specifications are usually set before development and can be negotiated with your team members.
CamelCase: ‘firstName = “John”; lastName = “Doe”;
Price = 19.90; Tax = 0.20;
fullPrice = price + (price * tax); Spaces and operators Usually add Spaces before and after the operator (= + – * /) :
Var x = y + z; var values = [“Volvo”, “Saab”, “Fiat”]; Indent code blocks are usually indent with 4 Spaces:
Function toCelsius(Fahrenheit) {return (4/9) * (Fahrenheit); }