In the rest of the book you will work on the source code of a real application (you can get the complete source code and development assets on GitHub https://github.com/GiorgioNatili/itinero). The following are some rules that I followed during the development of itinero:
All the constants will be named using only capital letters; if the constant name is made up of more than one word, an underscore will be used as a separator.
All the errors will be handled using custom exceptions, which makes it easier for you to debug the app because errors will be clearly identified by the exception itself.
Arrays and objects will always be instantiated using the literal form, in order to avoid any possible issues and to keep the code more readable.
Due to the fact that null
, undefined
, the empty string ''
, and the number 0
are all false
in Boolean expressions and the string '0'
, the empty array []
, and the empty object {}
are all true
in Boolean expressions, the value...