Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- function TwitterUser (name, handle, email, age) {
- // SET NAME, HANDLE, EMAIL, AND AGE IN THE BLANK SPACE BELOW (Hint: use "this")
- this.name = name;
- this.handle=handle;
- this.email=email;
- this.age=age;
- // do not edit below, creating empty arrays (lists) for followers and tweets
- this.following = [];
- this.tweets = [];
- }
- TwitterUser.prototype.updateName = function (newName) {
- // Directions: set newName, then console.log new name
- this.name=newName;
- console.log(newName);
- };
- TwitterUser.prototype.updateHandle = function (newHandle) {
- // Directions: set newHandle as this objects handle, then console.log new handle
- this.handle=newHandle;
- console.log(newHandle);
- };
- TwitterUser.prototype.updateEmail = function (newEmail) {
- // Directions: set newEmail as this objects email, then console.log new email
- };
- TwitterUser.prototype.tweet = function (tweetMessage) {
- // Directions: add (push) tweetMessage to the "tweets" array, then alert(tweetMessage)
- TwitterUser.prototype.tweet.push("tweetMessage")
- };
- TwitterUser.prototype.followUser = function (anotherTwitterUser) {
- // Directions: add (push) tweetMessage to the "following" array
- };
- TwitterUser.prototype.showFollowers = function (anotherTwitterUser) {
- // Directions: console.log each individual follower on a new line, by name (Hint: for loop)
- };
- TwitterUser.prototype.showTweets = function (anotherTwitterUser) {
- // Directions: console.log each individual tweet on a new line, by name (Hint: for loop)
- };
- var maurice = new TwitterUser("Maurice", "@superMaurice", "maurice@gmail.com", 16);
- var maggie = new TwitterUser("Maggie", "@superDuperMaggie", "maggie@gmail.com", 17);
- maurice.updateName("Maurice S.");
- maurice.updateHandle("@superMaurice1000");
- maurice.updateEmail("maurice1000@gmail.com");
- maurice.followUser(maggie);
- maurice.tweet("@superDuperMaggie cool handle!");
- maurice.showFollowers();
- maurice.showTweets();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">function TwitterUser (name, handle, email, age) {
- // SET NAME, HANDLE, EMAIL, AND AGE IN THE BLANK SPACE BELOW (Hint: use "this")
- this.name = name;
- this.handle=handle;
- this.email=email;
- this.age=age;
- // do not edit below, creating empty arrays (lists) for followers and tweets
- this.following = [];
- this.tweets = [];
- }
- TwitterUser.prototype.updateName = function (newName) {
- // Directions: set newName, then console.log new name
- this.name=newName;
- console.log(newName);
- };
- TwitterUser.prototype.updateHandle = function (newHandle) {
- // Directions: set newHandle as this objects handle, then console.log new handle
- this.handle=newHandle;
- console.log(newHandle);
- };
- TwitterUser.prototype.updateEmail = function (newEmail) {
- // Directions: set newEmail as this objects email, then console.log new email
- };
- TwitterUser.prototype.tweet = function (tweetMessage) {
- // Directions: add (push) tweetMessage to the "tweets" array, then alert(tweetMessage)
- TwitterUser.prototype.tweet.push("tweetMessage")
- };
- TwitterUser.prototype.followUser = function (anotherTwitterUser) {
- // Directions: add (push) tweetMessage to the "following" array
- };
- TwitterUser.prototype.showFollowers = function (anotherTwitterUser) {
- // Directions: console.log each individual follower on a new line, by name (Hint: for loop)
- };
- TwitterUser.prototype.showTweets = function (anotherTwitterUser) {
- // Directions: console.log each individual tweet on a new line, by name (Hint: for loop)
- };
- var maurice = new TwitterUser("Maurice", "@superMaurice", "maurice@gmail.com", 16);
- var maggie = new TwitterUser("Maggie", "@superDuperMaggie", "maggie@gmail.com", 17);
- maurice.updateName("Maurice S.");
- maurice.updateHandle("@superMaurice1000");
- maurice.updateEmail("maurice1000@gmail.com");
- maurice.followUser(maggie);
- maurice.tweet("@superDuperMaggie cool handle!");
- maurice.showFollowers();
- maurice.showTweets();</script></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement