-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpeakGoodBye.js
34 lines (22 loc) · 992 Bytes
/
SpeakGoodBye.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// NOTE! The steps in this file are basically identical to the ones you
// performed in the SpeakHello.js file.
// STEP 6: Wrap the entire contents of SpeakGoodBye.js inside of an IIFE
// See Lecture 52, part 2
// STEP 7: Create an object, called 'byeSpeaker' to which you will attach
// the "speak" method and which you will expose to the global context
// See Lecture 52, part 1
// var byeSpeaker =
// DO NOT attach the speakWord variable to the 'byeSpeaker' object.
// STEP 8: Rewrite the 'speak' function such that it is attached to the
// byeSpeaker object instead of being a standalone function.
// See Lecture 52, part 2
// STEP 9: Expose the 'byeSpeaker' object to the global scope. Name it
// 'byeSpeaker' on the global scope as well.
// xxxx.xxxx = byeSpeaker;
(function(window) {
var speakWord = "Good Bye";
var byeSpeaker = function (name) {
console.log(speakWord + " " + name);
}
window.byeSpeaker = byeSpeaker;
})(window);