diff options
author | Adam Bard <github@adambard.com> | 2013-08-14 08:28:19 -0700 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2013-08-14 08:28:19 -0700 |
commit | fa5354ebb3551ad075b35e863b28cd218db6a303 (patch) | |
tree | 032c3e2bb9dc8dec53b0a9b2db83c6b4805eb13c /es-es/coffeescript-es.html.markdown | |
parent | 6298fadf7997f9abac77bf839deafc60c4e4a228 (diff) | |
parent | f29098292c71a897efbcdbe702146831e5ca4831 (diff) |
Merge pull request #218 from pabloelices/master
CoffeeScript Spanish Translation.
Diffstat (limited to 'es-es/coffeescript-es.html.markdown')
-rw-r--r-- | es-es/coffeescript-es.html.markdown | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/es-es/coffeescript-es.html.markdown b/es-es/coffeescript-es.html.markdown new file mode 100644 index 00000000..a58c0d07 --- /dev/null +++ b/es-es/coffeescript-es.html.markdown @@ -0,0 +1,56 @@ +--- +language: coffeescript +lang: es-es +contributors: + - ["Tenor Biel", "http://github.com/L8D"] +translators: + - ["Pablo Elices", "http://github.com/pabloelices"] +filename: coffeescript-es.coffee +--- + +``` coffeescript +# CoffeeScript es un lenguaje hipster. +# Tiene convenciones de muchos lenguajes modernos. +# Los comentarios son como en Ruby y Python, usan almohadillas. + +### +Los comentarios en bloque son como estos, y se traducen directamente a '/*' y '*/' para el código JavaScript resultante. + +Deberías entender la mayor parte de la semántica de JavaScript antes de continuar. +### + +# Asignación: +number = 42 #=> var number = 42; +opposite = true #=> var opposite = true; + +# Condiciones: +number = -42 if opposite #=> if(opposite) { number = -42; } + +# Funciones: +square = (x) -> x * x #=> var square = function(x) { return x * x; } + +# Rangos: +list = [1..5] #=> var list = [1, 2, 3, 4, 5]; + +# Objetos: +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); } +#} + +# Símbolos: +race = (winner, runners...) -> + print winner, runners + +# Existencia: +alert "I knew it!" if elvis? +#=> if(typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); } + +# Colecciones por comprensión: +cubes = (math.cube num for num in list) #=> ... +``` |