-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscripts.js
More file actions
65 lines (31 loc) · 714 Bytes
/
scripts.js
File metadata and controls
65 lines (31 loc) · 714 Bytes
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
35
36
37
38
39
40
function concatStrings() {
var str = "";
//console.log(arguments);
for(var i = 0; i < arguments.length; i++) {
str += arguments[i] + " ";
}
console.log(str);
}
concatStrings("hello", "world", "is", "a", "string");
function addNumbers() {
var sum = 0;
for(var i = 0 ; i < arguments.length; i++) {
sum += arguments[i];
}
console.log(sum);
}
var myObj = {};
myObj.color = 'green';
myObj.changeColor = function(newColor) {
this.color = newColor;
}
var myClass = function() {
this.color = 'green';
var color2 = 'blue';
this.changeColor = function(newColor) {
this.color = newColor;
console.log(this.color);
console.log(color2);
}
};
myClass.color3 = 'red';