Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions 01_properties/properties.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
var object;
// The test specs create an object that is passed to the setPropertiesOnObjLiteral function, you do not have to create the object that
// is passed to your functions, the test specs do this work for you.

// var object;

function setPropertiesOnObjLiteral(object) {
object.x = 7;
Expand All @@ -8,7 +11,10 @@ function setPropertiesOnObjLiteral(object) {
};
}

setPropertiesOnObjLiteral(object);
// You don't have to invoke the function either, the test specs will read the properties.js file first, then it will take any functions
// and code defined and use it in the test specs. The testspecs invoke all of your functions and checks what values they return (.toEqual).

// setPropertiesOnObjLiteral(object);

function setPropertiesOnArrayObj(arrObject) {
arrObject.hello = function() {
Expand All @@ -21,13 +27,14 @@ function setPropertiesOnArrayObj(arrObject) {
}
}

var arrObject;
// var arrObject;

setPropertiesOnArrayObj(arrObject);
// setPropertiesOnArrayObj(arrObject);

functionObject = function() {
return "I am a function object, all functions are objects! Function can have their own properties too!";
}
// This is defined in the test spec.
// var functionObject = function() {
// return "I am a function object, all functions are objects! Function can have their own properties too!";
// }

function setPropertiesOnFunctionObj(func) {
func.year = 2015;
Expand All @@ -39,4 +46,4 @@ function setPropertiesOnFunctionObj(func) {
}
}

setPropertiesOnFunctionObj(functionObject);
// setPropertiesOnFunctionObj(functionObject);