diff options
author | wikibook <dylee@wikibook.kr> | 2013-08-20 10:46:10 +0900 |
---|---|---|
committer | wikibook <dylee@wikibook.kr> | 2013-08-20 10:46:10 +0900 |
commit | 276d73bdd3b1e43c471a86191dcda87c7e3c5241 (patch) | |
tree | e13b9640f2a54cb4378eef1c6ef70c08ae8b2175 /fr-fr/coffeescript-fr.html.markdown | |
parent | 4e7f0ce330914cded8be937b8e5f1700350623d2 (diff) | |
parent | f33dea8b83bf64ecde36337a5e02cae77f5210de (diff) |
fix typo in Java tutorial
Diffstat (limited to 'fr-fr/coffeescript-fr.html.markdown')
-rw-r--r-- | fr-fr/coffeescript-fr.html.markdown | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/fr-fr/coffeescript-fr.html.markdown b/fr-fr/coffeescript-fr.html.markdown new file mode 100644 index 00000000..c66b7be0 --- /dev/null +++ b/fr-fr/coffeescript-fr.html.markdown @@ -0,0 +1,58 @@ +--- +language: coffeescript +contributors: + - ["Tenor Biel", "http://github.com/L8D"] +translators: + - ["Geoffrey Roguelon", "https://github.com/GRoguelon"] +lang: fr-fr +filename: coffeescript-fr.coffee +--- + +``` coffeescript +# CoffeeScript est un langage préprocesseur, il permet de générer du Javascript. +# Il suit les tendances de certains langages récents. +# Par exemple, les commentaires se définissent comme en Ruby ou en Python. + +### +Ceci est un bloc de commentaires +il est converti directement avec '/ *' et '* /' +pour correspondre aux commentaires Javascript + +Vous devez comprendre la syntaxe du langage JavaScript pour continuer. +### + +# Affectation : +number = 42 #=> var number = 42; +opposite = true #=> var opposite = true; + +# Structures de contrôle : +number = -42 if opposite #=> if(opposite) { number = -42; } + +# Fonctions : +square = (x) -> x * x #=> var square = function(x) { return x * x; } + +# Intervals : +list = [1..5] #=> var list = [1, 2, 3, 4, 5]; + +# Objets : +math = + root: Math.sqrt + square: square + cube: (x) -> x * square x +#=> var math = { +# "root": Math.sqrt, +# "square": square, +# "cube": function(x) { return x * square(x); } +#} + +# Liste d'arguments variables : +race = (winner, runners...) -> + print winner, runners + +# Existance : +alert "I knew it!" if elvis? +#=> if(typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); } + +# Lecture d'un tableau : +cubes = (math.cube num for num in list) #=> ... +``` |