From ab482bf60552d2b862780fa58c5ed84283cc75f7 Mon Sep 17 00:00:00 2001 From: eenymini Date: Thu, 19 Nov 2015 13:40:45 -0500 Subject: [PATCH] done --- .babelrc | 1 + output.js | 15 +++++++++++++++ person.js | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100644 .babelrc create mode 100644 output.js create mode 100644 person.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..7a870ac --- /dev/null +++ b/.babelrc @@ -0,0 +1 @@ +{ "presets": ["es2015"] } \ No newline at end of file diff --git a/output.js b/output.js new file mode 100644 index 0000000..3f999dc --- /dev/null +++ b/output.js @@ -0,0 +1,15 @@ +"use strict"; + +var steven = { + name: "Steven", + friends: ["Jeff", "Josh", "Joe"], + displayFriends: function displayFriends() { + var _this = this; + + console.log("Listing friends for " + this.name); + this.friends.forEach(function (friend) { + console.log(friend + " is friends with " + _this.name); + }); + } +}; +steven.displayFriends(); diff --git a/person.js b/person.js new file mode 100644 index 0000000..2c0a494 --- /dev/null +++ b/person.js @@ -0,0 +1,11 @@ +var steven = { + name: "Steven", + friends: ["Jeff", "Josh", "Joe"], + displayFriends(){ + console.log("Listing friends for " + this.name); + this.friends.forEach((friend) => { + console.log(`${friend} is friends with ${this.name}`); + }) + } +} +steven.displayFriends(); \ No newline at end of file