Skip to content
Browse files

Fixed minor Markdown syntax errors

  • Loading branch information...
1 parent 419008c commit 6fe929dc4d8b7fe471e74827debba49e356eedf2 @Rafase282 Rafase282 committed
Showing with 7 additions and 7 deletions.
  1. +5 −5 js-Array-prototype-join.md
  2. +2 −2 js-Array-prototype-reverse.md
View
10 js-Array-prototype-join.md
@@ -2,7 +2,7 @@
The JavaScript array method `.join()` will combine all elements of an array into a single string.
-##Syntax
+## Syntax
```js
var array = ["Lorem", "Ipsum", "Dolor", "Sit"];
var str = array.join([separator]);
@@ -12,11 +12,11 @@ var str = array.join([separator]);
**separator**
Optional. Specifies the string to use to separate each element of the original array. If the separator is not a
- string, it will be converted to a string. If separator parameter is not provided, array elements are separated
+ string, it will be converted to a string. If separator parameter is not provided, array elements are separated
with a comma by default. If separator is an empty string `""`, all array elements are joined without a separator
character between them.
-## Description
+## Description
`.join()` joins all elements of an array into a single string. If any of the array elements are `undefined` or `null`,
that element is converted to the empty string `""`.
@@ -29,8 +29,8 @@ that element is converted to the empty string `""`.
```js
var array = ["Lorem", "Ipsum", "Dolor" ,"Sit"];
-var join1 = array.join(); /* assigns "Lorem,Ipsum,Dolor,Sit" to join1 variable
- (because no separator was provided .join()
+var join1 = array.join(); /* assigns "Lorem,Ipsum,Dolor,Sit" to join1 variable
+ (because no separator was provided .join()
defaulted to using a comma) */
var join2 = array.join(", "); // assigns "Lorem, Ipsum, Dolor, Sit" to join2 variable
var join3 = array.join(" + "); // assigns "Lorem + Ipsum + Dolor + Sit" to join3 variable
View
4 js-Array-prototype-reverse.md
@@ -2,7 +2,7 @@
The JavaScript array method `.reverse()` will reverse the order of the elements within the array.
-##Syntax
+## Syntax
```js
var array = [1, 2, 3, 4, 5];
array.reverse();
@@ -24,7 +24,7 @@ console.log(array);
array.reverse();
console.log(array);
-/* Console will output 5, 4, 3, 2, 1 and
+/* Console will output 5, 4, 3, 2, 1 and
the variable array now contains the set [5, 4, 3, 2, 1] */
```

0 comments on commit 6fe929d

Please sign in to comment.
Something went wrong with that request. Please try again.