You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: es/index.html
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -34,25 +34,25 @@ <h2>Licencia</h2>
34
34
<p>El Jardín de JavaScript es publicado bajo la <ahref="https://github.com/BonsaiDen/JavaScript-Garden/blob/next/LICENSE">licencia MIT</a> y es hospedado en
35
35
<ahref="https://github.com/BonsaiDen/JavaScript-Garden">GitHub</a>. Si encuentra algún error o errata por favor publique <ahref="https://github.com/BonsaiDen/JavaScript-Garden/issues">una incidencia</a> o
36
36
envie un pull request a nuestro repositorio. También nos puede encontrar en la
37
-
<ahref="http://chat.stackoverflow.com/rooms/17/javascript">sala de chat de JavaScript</a> en Stack Overflow.</p></div></header><!-- Articles--></section><sectionid="object"><!-- Introduction--><headerid="object.intro"><h1>Objetos</h1></header><!-- Articles--><articleid="object.general"><h2>Uso de objetos y propiedades</h2><div><p>Todo en JavaScript actúa como un objeto, con las dos únicas excepciones de
37
+
<ahref="http://chat.stackoverflow.com/rooms/17/javascript">sala de chat de JavaScript</a> en Stack Overflow.</p></div></header><!-- Articles--></section><sectionid="object"><!-- Introduction--><headerid="object.intro"><h1>Objetos</h1></header><!-- Articles--><articleid="object.general"><h2>Uso de objetos y propiedades</h2><div><p>Todo en JavaScript actúa como un objeto, con las dos únicas excepciones de
38
38
<ahref="#core.undefined"><code>null</code></a> y <ahref="#core.undefined"><code>undefined</code></a>.</p>
39
39
40
-
<pre><code>false.toString() // 'false'
40
+
<pre><code>false.toString(); // 'false'
41
41
[1, 2, 3].toString(); // '1,2,3'
42
42
43
43
function Foo(){}
44
44
Foo.bar = 1;
45
45
Foo.bar; // 1
46
46
</code></pre>
47
47
48
-
<p>Un error muy común es el uso de literales númericos como objetos.
48
+
<p>Un error muy común es el uso de literales númericos como objetos.
49
49
Esto se debe a un error en el parser de JavaScript que intenta analizar la
50
50
<em>notación de puntos</em> como un literal de punto flotante.</p>
51
51
52
52
<pre><code>2.toString(); // lanza SyntaxError
53
53
</code></pre>
54
54
55
-
<p>Existe un par de soluciones que pueden utilizarse para hacer que los
55
+
<p>Existe un par de soluciones que pueden utilizarse para hacer que los
56
56
literales númericos actúen como objetos.</p>
57
57
58
58
<pre><code>2..toString(); // el segundo punto es reconocido correctamente
@@ -62,23 +62,23 @@ <h2>Licencia</h2>
62
62
63
63
</div><div><h3>Objetos como un tipo de datos</h3>
64
64
65
-
<p>Los objetos en JavaScript también pueden ser utilizados como una Tabla Hash o conocido como <ahref="http://en.wikipedia.org/wiki/Hashmap"><em>Hashmap</em></a> en inglés, consisten
65
+
<p>Los objetos en JavaScript también pueden ser utilizados como una Tabla Hash o conocido como <ahref="http://en.wikipedia.org/wiki/Hashmap"><em>Hashmap</em></a> en inglés, consisten
66
66
principalmente en nombres de propiedades asignadoles valores a estos.</p>
67
67
68
-
<p>El uso de un objeto literal - con notación <code>{}</code> - puede crear un
68
+
<p>El uso de un objeto literal - con notación <code>{}</code> - puede crear un
69
69
objeto plano. Este nuevo objeto <ahref="#object.prototype">heredado</a> desde <code>Object.prototype</code>
70
70
no posee <ahref="#object.hasownproperty">propiedades propias</a> definidas.</p>
71
71
72
72
<pre><code>var foo = {}; // un nuevo objeto vacío
73
73
74
74
// un nuevo objeto con la propiedad llamada 'test' con el valor 12
75
-
var bar = {test: 12};
75
+
var bar = {test: 12};
76
76
</code></pre>
77
77
78
78
</div><div><h3>Acceso a las propiedades</h3>
79
79
80
80
<p>Se puede acceder a las propiedades de un objeto de dos maneras, ya sea a través de la
81
-
notación de punto o desde la notación de corchetes.</p>
81
+
notación de punto o desde la notación de corchetes.</p>
82
82
83
83
<pre><code>var foo = {name: 'Kitten'}
84
84
foo.name; // kitten
@@ -98,8 +98,8 @@ <h2>Licencia</h2>
98
98
</div><div><h3>Eliminando propiedades</h3>
99
99
100
100
<p>La única manera de eliminar una propiedad desde un objeto es usando el
101
-
operador <code>delete</code>; Se establece la propiedad a <code>undefined</code> o <code>null</code>sólo al
102
-
<em>valor</em> asociado de la propiedad, pero no ha un<em>key</em> (valor clave).</p>
101
+
operador <code>delete</code>; establecer la propiedad a <code>undefined</code> o <code>null</code>solamente
102
+
elimina el <em>valor</em> asociado a la propiedad, pero no la<em>key</em> (valor clave).</p>
</ul></div></article><articleid="intro.license"><h2>Lisenssi</h2><div><p>JavaScript-puutarha on julkaistu <ahref="https://github.com/BonsaiDen/JavaScript-Garden/blob/next/LICENSE">MIT-lisenssin</a>-alaisena ja se on saatavilla <ahref="https://github.com/BonsaiDen/JavaScript-Garden">GitHubissa</a>. Mikäli löydät virheitä, lisää se <ahref="https://github.com/BonsaiDen/JavaScript-Garden/issues">seurantajärjestelmään</a> tai tee <code>pull</code>-pyyntö. Löydät meidät myös <ahref="http://chat.stackoverflow.com/rooms/17/javascript">JavaScript huoneesta</a> Stack Overflown chatista.</p></div></article></section><sectionid="object"><!-- Introduction--><headerid="object.intro"><h1>Oliot</h1></header><!-- Articles--><articleid="object.general"><h2>Olioiden käyttö ja ominaisuudet</h2><div><p>Kaikki muuttujat, kahta poikkeusta lukuunottamatta, käyttäytyvät JavaScriptissä oliomaisesti. Nämä poikkeukset ovat <ahref="#core.undefined"><code>null</code></a> sekä <ahref="#core.undefined"><code>undefined</code></a>.</p>
Copy file name to clipboardExpand all lines: index.html
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ <h2>License</h2>
37
37
Stack Overflow chat.</p></div></header><!-- Articles--></section><sectionid="object"><!-- Introduction--><headerid="object.intro"><h1>Objects</h1></header><!-- Articles--><articleid="object.general"><h2>Object Usage and Properties</h2><div><p>Everything in JavaScript acts like an object, with the only two exceptions being
38
38
<ahref="#core.undefined"><code>null</code></a> and <ahref="#core.undefined"><code>undefined</code></a>.</p>
39
39
40
-
<pre><code>false.toString() // 'false'
40
+
<pre><code>false.toString(); // 'false'
41
41
[1, 2, 3].toString(); // '1,2,3'
42
42
43
43
function Foo(){}
@@ -65,7 +65,7 @@ <h2>License</h2>
65
65
<p>Objects in JavaScript can also be used as a <ahref="http://en.wikipedia.org/wiki/Hashmap"><em>Hashmap</em></a>; they mainly consist
66
66
of named properties mapping to values.</p>
67
67
68
-
<p>Using a object literal - <code>{}</code> notation - it is possible to create a
68
+
<p>Using an object literal - <code>{}</code> notation - it is possible to create a
69
69
plain object. This new object <ahref="#object.prototype">inherits</a> from <code>Object.prototype</code> and
70
70
has no <ahref="#object.hasownproperty">own properties</a> defined on it.</p>
71
71
@@ -80,7 +80,7 @@ <h2>License</h2>
80
80
<p>The properties of an object can be accessed in two ways, via either the dot
81
81
notation or the square bracket notation.</p>
82
82
83
-
<pre><code>var foo = {name: 'Kitten'}
83
+
<pre><code>var foo = {name: 'kitten'}
84
84
foo.name; // kitten
85
85
foo['name']; // kitten
86
86
@@ -295,7 +295,7 @@ <h2>License</h2>
295
295
// Use another Object's hasOwnProperty and call it with 'this' set to foo
assumptions be made about the environment the code is running in, or whether the
358
358
native prototypes have been extended or not.</p></div></article></section><sectionid="function"><!-- Introduction--><headerid="function.intro"><h1>Functions</h1></header><!-- Articles--><articleid="function.general"><h2>Function Declarations and Expressions</h2><div><p>Functions in JavaScript are first class objects. That means they can be
359
359
passed around like any other value. One common use of this feature is to pass
360
-
an <em>anonymous function</em> as a callback to another, possibly asynchronous function.</p>
360
+
an <em>anonymous function</em> as a callback to another, possibly an asynchronous function.</p>
<p>Without the knowledge about <em>hoisting</em>, the below code might seem to raise a
1033
1033
<code>ReferenceError</code>.</p>
1034
1034
1035
-
<pre><code>// check whether SomeImportantThing has been initiliazed
1035
+
<pre><code>// check whether SomeImportantThing has been initialized
1036
1036
if (!SomeImportantThing) {
1037
1037
var SomeImportantThing = {};
1038
1038
}
@@ -1043,7 +1043,7 @@ <h2>License</h2>
1043
1043
1044
1044
<pre><code>var SomeImportantThing;
1045
1045
1046
-
// other code might initiliaze SomeImportantThing here, or not
1046
+
// other code might initialize SomeImportantThing here, or not
1047
1047
1048
1048
// make sure it's there
1049
1049
if (!SomeImportantThing) {
@@ -1117,7 +1117,7 @@ <h2>License</h2>
1117
1117
1118
1118
<p>Additionally, the use of global variables is considered <strong>bad practice</strong>. <strong>Any</strong>
1119
1119
use of them indicates badly written code that is prone to errors and hard to maintain.</p></div></article></section><sectionid="array"><!-- Introduction--><headerid="array.intro"><h1>Arrays</h1></header><!-- Articles--><articleid="array.general"><h2>Array Iteration and Properties</h2><div><p>Although arrays in JavaScript are objects, there are no good reasons to use
1120
-
the <ahref="#object.forinloop"><code>for in loop</code></a>in for iteration on them. In fact, there
1120
+
the <ahref="#object.forinloop"><code>for in</code></a>loop. In fact, there
1121
1121
are a number of good reasons <strong>against</strong> the use of <code>for in</code> on arrays.</p>
<p>Assigning a smaller length does truncate the array, but increasing the length
1171
-
does not have any effect on the array.</p>
1171
+
<p>Assigning a smaller length truncates the array. Increasing it creates a sparse array.</p>
1172
1172
1173
1173
</div><div><h3>In Conclusion</h3>
1174
1174
@@ -1280,7 +1280,7 @@ <h2>License</h2>
1280
1280
where types need to be coerced, it should be done <ahref="#types.casting">explicitly</a>
1281
1281
and not left to the language's complicated coercion rules.</p></div></article><articleid="types.typeof"><h2>The <code>typeof</code> Operator</h2><div><p>The <code>typeof</code> operator (together with
1282
1282
<ahref="#types.instanceof"><code>instanceof</code></a>) is probably the biggest
1283
-
design flaw of JavaScript, as it is near of being<strong>completely broken</strong>.</p>
1283
+
design flaw of JavaScript, as it is nearly<strong>completely broken</strong>.</p>
1284
1284
1285
1285
<p>Although <code>instanceof</code> still has its limited uses, <code>typeof</code> really has only one
1286
1286
practical use case, which does <strong>not</strong> happen to be checking the type of an
@@ -1766,10 +1766,10 @@ <h2>License</h2>
1766
1766
</code></pre>
1767
1767
1768
1768
<p>Here we use a trick to delete <code>a</code>. <ahref="#function.this"><code>this</code></a> here refers
1769
-
to the Global object and we explicitly declare variable <code>a</code> as it's property
1769
+
to the Global object and we explicitly declare variable <code>a</code> as its property
1770
1770
which allows us to delete it.</p>
1771
1771
1772
-
<p>IE (at least 6-8) has some bugs, so code above doesn't work.</p>
1772
+
<p>IE (at least 6-8) has some bugs, so the code above doesn't work.</p>
1773
1773
1774
1774
</div><div><h3>Function arguments and built-ins</h3>
0 commit comments