8. Atwood Law
• «Any application that can be written in
JavaScript, will eventually be written in
JavaScript»
• http://www.codinghorror.com/blog/
2007/07/the-principle-of-least-power.html
33. Objet
• Container de propriétés avec un nom et une
valeur
• nom de propriété est une string y compris ""
34. Objet
• Container de propriétés avec un nom et une
valeur
• nom de propriété est une string y compris ""
• propriété est n’importe quelle valeur sauf
undefined
51. Héritage par prototype
• Un objet hérite directement d’un autre
objet, il n’y a pas de notion de classe
• On place les propriétés communes dans le
prototype pour la mémoire
117. Truthy et Falsy
• false, "", 0, null, undefined, NaN, void sont
FALSY
118. Truthy et Falsy
• false, "", 0, null, undefined, NaN, void sont
FALSY
• Tous les autres sont TRUTHY
119. Truthy et Falsy
• false, "", 0, null, undefined, NaN, void sont
FALSY
• Tous les autres sont TRUTHY
• même "0" et "FALSE"
120. Truthy et Falsy
• false, "", 0, null, undefined, NaN, void sont
FALSY
• Tous les autres sont TRUTHY
• même "0" et "FALSE"
• if( array.length )
121. Truthy et Falsy
• false, "", 0, null, undefined, NaN, void sont
FALSY
• Tous les autres sont TRUTHY
• même "0" et "FALSE"
• if( array.length )
• if( string )
161. IIFE
• Immediatly Invoked Function Expression
• Fonction exécutée au chargement du script
et qui renvoie un objet avec les fonctions/
variables utiles.
241. use strict
!
• En haut du script ou dans une fonction
• Transforme en erreur certaines fautes
• déclaration implicite de variable
• syntaxe octale
• double propriété
242. JSLint / JSHint
• attention cela fait mal.
• utiliser dès le début avant les mauvaises
habitudes !
• en ligne ou en plugin
250. Creative Commons
Attribution — You must attribute the work in the
manner specified by the author or licensor (but not in
any way that suggests that they endorse you or your use
of the work).
!
Noncommercial — You may not use this work for
commercial purposes.
!
Share Alike — If you alter, transform, or build upon this
work, you may distribute the resulting work only under
the same or similar license to this one.