JavaScript is Syntactically a C Family Language

 

JavaScript is Syntactically a C Family Language

-It differs from C mainly in its type system which allows functions to be values
Identifiers

  • Starts with a letter or _ or $
  • Followed by zero or more letters, digits, _ or $
  • Case Sensitibbe
  • by convention, all bariables, parameters, membersm and function names start with lower case
  • except for constructors which start with upper case
  • intitial _ should be reserved for implementations
  • @ should be reserved for machines (better to avoid)

Reserved Words

  • abstract
  • boolean break byte
  • case catch char class const continue
  • debugger default delete do double
  • else enum export extends
  • false final finally  float for function
  • goto
  • if implements import in instanceof int interfence
  • long
  • native new null
  • package private protected public
  • return
  • short static super switch synchronized
  • this throw throws transient true try typeof
  • var volatile void
  • while with

Comments

  • //  line comment
  • /* block comment */

Operators

  • Arithmetic: +   –   *   /   %
  • Comparison: ==    !-    <>    <=   >=
  • Logical: &&   ||   !
  • Bitwise:   $     |     ^    >>    >>>     <<
  • Ternary:  ?:

Leave a comment