summaryrefslogtreecommitdiffhomepage
path: root/javascript.html.markdown
diff options
context:
space:
mode:
authorRaphael Nascimento <raphaelbn10@gmail.com>2015-10-08 18:34:03 -0300
committerRaphael Nascimento <raphaelbn10@gmail.com>2015-10-08 18:34:03 -0300
commitc3914e277bafb320a37617c4a41984462be1a20d (patch)
treeb766ebbf99e527a2138f0daab0404b1965601438 /javascript.html.markdown
parentf1711ddd4c98633f059558b8d13e2532afbb5ba7 (diff)
Added for/in loop JavaScript
Fixing code style
Diffstat (limited to 'javascript.html.markdown')
-rw-r--r--javascript.html.markdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/javascript.html.markdown b/javascript.html.markdown
index f7a662a4..0e38be8f 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -221,7 +221,7 @@ for (var i = 0; i < 5; i++){
//The For/In statement loops iterates over every property across the entire prototype chain
var description = "";
var person = {fname:"Paul", lname:"Ken", age:18};
-for (var x in person) {
+for (var x in person){
description += person[x] + " ";
}
@@ -229,8 +229,8 @@ for (var x in person) {
//and not its prototypes use hasOwnProperty() check
var description = "";
var person = {fname:"Paul", lname:"Ken", age:18};
-for (var x in person) {
- if( person.hasOwnProperty( x ) ) {
+for (var x in person){
+ if (person.hasOwnProperty(x)){
description += person[x] + " ";
}
}