Skip to content

Commit 095abab

Browse files
committed
Update
1 parent 67775b0 commit 095abab

File tree

9 files changed

+254
-158
lines changed

9 files changed

+254
-158
lines changed

es/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ <h2>Licencia</h2>
3434
<p>El Jardín de JavaScript es publicado bajo la <a href="https://github.com/BonsaiDen/JavaScript-Garden/blob/next/LICENSE">licencia MIT</a> y es hospedado en
3535
<a href="https://github.com/BonsaiDen/JavaScript-Garden">GitHub</a>. Si encuentra algún error o errata por favor publique <a href="https://github.com/BonsaiDen/JavaScript-Garden/issues">una incidencia</a> o
3636
envie un pull request a nuestro repositorio. También nos puede encontrar en la
37-
<a href="http://chat.stackoverflow.com/rooms/17/javascript">sala de chat de JavaScript</a> en Stack Overflow.</p></div></header><!-- Articles--></section><section id="object"><!-- Introduction--><header id="object.intro"><h1>Objetos</h1></header><!-- Articles--><article id="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+
<a href="http://chat.stackoverflow.com/rooms/17/javascript">sala de chat de JavaScript</a> en Stack Overflow.</p></div></header><!-- Articles--></section><section id="object"><!-- Introduction--><header id="object.intro"><h1>Objetos</h1></header><!-- Articles--><article id="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
3838
<a href="#core.undefined"><code>null</code></a> y <a href="#core.undefined"><code>undefined</code></a>.</p>
3939

40-
<pre><code>false.toString() // &#39;false&#39;
40+
<pre><code>false.toString(); // &#39;false&#39;
4141
[1, 2, 3].toString(); // &#39;1,2,3&#39;
4242

4343
function Foo(){}
4444
Foo.bar = 1;
4545
Foo.bar; // 1
4646
</code></pre>
4747

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.
4949
Esto se debe a un error en el parser de JavaScript que intenta analizar la
5050
<em>notación de puntos</em> como un literal de punto flotante.</p>
5151

5252
<pre><code>2.toString(); // lanza SyntaxError
5353
</code></pre>
5454

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
5656
literales númericos actúen como objetos.</p>
5757

5858
<pre><code>2..toString(); // el segundo punto es reconocido correctamente
@@ -62,23 +62,23 @@ <h2>Licencia</h2>
6262

6363
</div><div><h3>Objetos como un tipo de datos</h3>
6464

65-
<p>Los objetos en JavaScript también pueden ser utilizados como una Tabla Hash o conocido como <a href="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 <a href="http://en.wikipedia.org/wiki/Hashmap"><em>Hashmap</em></a> en inglés, consisten
6666
principalmente en nombres de propiedades asignadoles valores a estos.</p>
6767

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
6969
objeto plano. Este nuevo objeto <a href="#object.prototype">heredado</a> desde <code>Object.prototype</code>
7070
no posee <a href="#object.hasownproperty">propiedades propias</a> definidas.</p>
7171

7272
<pre><code>var foo = {}; // un nuevo objeto vacío
7373

7474
// un nuevo objeto con la propiedad llamada &#39;test&#39; con el valor 12
75-
var bar = {test: 12};
75+
var bar = {test: 12};
7676
</code></pre>
7777

7878
</div><div><h3>Acceso a las propiedades</h3>
7979

8080
<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>
8282

8383
<pre><code>var foo = {name: &#39;Kitten&#39;}
8484
foo.name; // kitten
@@ -98,8 +98,8 @@ <h2>Licencia</h2>
9898
</div><div><h3>Eliminando propiedades</h3>
9999

100100
<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>
103103

104104
<pre><code>var obj = {
105105
bar: 1,

fi/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<li><a href="https://github.com/bebraw">Juho Vepsäläinen</a></li>
1111
</ul></div></article><article id="intro.license"><h2>Lisenssi</h2><div><p>JavaScript-puutarha on julkaistu <a href="https://github.com/BonsaiDen/JavaScript-Garden/blob/next/LICENSE">MIT-lisenssin</a>-alaisena ja se on saatavilla <a href="https://github.com/BonsaiDen/JavaScript-Garden">GitHubissa</a>. Mikäli löydät virheitä, lisää se <a href="https://github.com/BonsaiDen/JavaScript-Garden/issues">seurantajärjestelmään</a> tai tee <code>pull</code>-pyyntö. Löydät meidät myös <a href="http://chat.stackoverflow.com/rooms/17/javascript">JavaScript huoneesta</a> Stack Overflown chatista.</p></div></article></section><section id="object"><!-- Introduction--><header id="object.intro"><h1>Oliot</h1></header><!-- Articles--><article id="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 <a href="#core.undefined"><code>null</code></a> sekä <a href="#core.undefined"><code>undefined</code></a>.</p>
1212

13-
<pre><code>false.toString() // epätosi
13+
<pre><code>false.toString(); // epätosi
1414
[1, 2, 3].toString(); // &#39;1,2,3&#39;
1515

1616
function Foo(){}

index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h2>License</h2>
3737
Stack Overflow chat.</p></div></header><!-- Articles--></section><section id="object"><!-- Introduction--><header id="object.intro"><h1>Objects</h1></header><!-- Articles--><article id="object.general"><h2>Object Usage and Properties</h2><div><p>Everything in JavaScript acts like an object, with the only two exceptions being
3838
<a href="#core.undefined"><code>null</code></a> and <a href="#core.undefined"><code>undefined</code></a>.</p>
3939

40-
<pre><code>false.toString() // &#39;false&#39;
40+
<pre><code>false.toString(); // &#39;false&#39;
4141
[1, 2, 3].toString(); // &#39;1,2,3&#39;
4242

4343
function Foo(){}
@@ -65,7 +65,7 @@ <h2>License</h2>
6565
<p>Objects in JavaScript can also be used as a <a href="http://en.wikipedia.org/wiki/Hashmap"><em>Hashmap</em></a>; they mainly consist
6666
of named properties mapping to values.</p>
6767

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
6969
plain object. This new object <a href="#object.prototype">inherits</a> from <code>Object.prototype</code> and
7070
has no <a href="#object.hasownproperty">own properties</a> defined on it.</p>
7171

@@ -80,7 +80,7 @@ <h2>License</h2>
8080
<p>The properties of an object can be accessed in two ways, via either the dot
8181
notation or the square bracket notation.</p>
8282

83-
<pre><code>var foo = {name: &#39;Kitten&#39;}
83+
<pre><code>var foo = {name: &#39;kitten&#39;}
8484
foo.name; // kitten
8585
foo[&#39;name&#39;]; // kitten
8686

@@ -295,7 +295,7 @@ <h2>License</h2>
295295
// Use another Object&#39;s hasOwnProperty and call it with &#39;this&#39; set to foo
296296
({}).hasOwnProperty.call(foo, &#39;bar&#39;); // true
297297

298-
// It&#39;s also possible use the hasOwnProperty property from the Object property for this purpuse
298+
// It&#39;s also possible use the hasOwnProperty property from the Object property for this purpose
299299
Object.prototype.hasOwnProperty.call(obj, &#39;bar&#39;); // true
300300
</code></pre>
301301

@@ -357,7 +357,7 @@ <h2>License</h2>
357357
assumptions be made about the environment the code is running in, or whether the
358358
native prototypes have been extended or not.</p></div></article></section><section id="function"><!-- Introduction--><header id="function.intro"><h1>Functions</h1></header><!-- Articles--><article id="function.general"><h2>Function Declarations and Expressions</h2><div><p>Functions in JavaScript are first class objects. That means they can be
359359
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>
361361

362362
</div><div><h3>The <code>function</code> Declaration</h3>
363363

@@ -1032,7 +1032,7 @@ <h2>License</h2>
10321032
<p>Without the knowledge about <em>hoisting</em>, the below code might seem to raise a
10331033
<code>ReferenceError</code>.</p>
10341034

1035-
<pre><code>// check whether SomeImportantThing has been initiliazed
1035+
<pre><code>// check whether SomeImportantThing has been initialized
10361036
if (!SomeImportantThing) {
10371037
var SomeImportantThing = {};
10381038
}
@@ -1043,7 +1043,7 @@ <h2>License</h2>
10431043

10441044
<pre><code>var SomeImportantThing;
10451045

1046-
// other code might initiliaze SomeImportantThing here, or not
1046+
// other code might initialize SomeImportantThing here, or not
10471047

10481048
// make sure it&#39;s there
10491049
if (!SomeImportantThing) {
@@ -1117,7 +1117,7 @@ <h2>License</h2>
11171117

11181118
<p>Additionally, the use of global variables is considered <strong>bad practice</strong>. <strong>Any</strong>
11191119
use of them indicates badly written code that is prone to errors and hard to maintain.</p></div></article></section><section id="array"><!-- Introduction--><header id="array.intro"><h1>Arrays</h1></header><!-- Articles--><article id="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 <a href="#object.forinloop"><code>for in loop</code></a> in for iteration on them. In fact, there
1120+
the <a href="#object.forinloop"><code>for in</code></a> loop. In fact, there
11211121
are a number of good reasons <strong>against</strong> the use of <code>for in</code> on arrays.</p>
11221122

11231123
<aside>
@@ -1164,11 +1164,11 @@ <h2>License</h2>
11641164
foo; // [1, 2, 3]
11651165

11661166
foo.length = 6;
1167-
foo; // [1, 2, 3]
1167+
foo.push(4);
1168+
foo; // [1, 2, 3, undefined, undefined, undefined, 4]
11681169
</code></pre>
11691170

1170-
<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>
11721172

11731173
</div><div><h3>In Conclusion</h3>
11741174

@@ -1280,7 +1280,7 @@ <h2>License</h2>
12801280
where types need to be coerced, it should be done <a href="#types.casting">explicitly</a>
12811281
and not left to the language&#39;s complicated coercion rules.</p></div></article><article id="types.typeof"><h2>The <code>typeof</code> Operator</h2><div><p>The <code>typeof</code> operator (together with
12821282
<a href="#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>
12841284

12851285
<p>Although <code>instanceof</code> still has its limited uses, <code>typeof</code> really has only one
12861286
practical use case, which does <strong>not</strong> happen to be checking the type of an
@@ -1766,10 +1766,10 @@ <h2>License</h2>
17661766
</code></pre>
17671767

17681768
<p>Here we use a trick to delete <code>a</code>. <a href="#function.this"><code>this</code></a> here refers
1769-
to the Global object and we explicitly declare variable <code>a</code> as it&#39;s property
1769+
to the Global object and we explicitly declare variable <code>a</code> as its property
17701770
which allows us to delete it.</p>
17711771

1772-
<p>IE (at least 6-8) has some bugs, so code above doesn&#39;t work.</p>
1772+
<p>IE (at least 6-8) has some bugs, so the code above doesn&#39;t work.</p>
17731773

17741774
</div><div><h3>Function arguments and built-ins</h3>
17751775

@@ -1951,7 +1951,7 @@ <h2>License</h2>
19511951
<pre><code>function foo(a, b, c) {}
19521952

19531953
// NEVER use this
1954-
setTimeout(&#39;foo(1,2, 3)&#39;, 1000)
1954+
setTimeout(&#39;foo(1, 2, 3)&#39;, 1000)
19551955

19561956
// Instead use an anonymous function
19571957
setTimeout(function() {

0 commit comments

Comments
 (0)