-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.js
27 lines (24 loc) · 910 Bytes
/
index.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
$(document).ready(function() {
var source = {
id: 2,
name: "Blue lamp",
description: null,
ui: undefined,
price: 10,
purchasePrice: 6,
purchaseDate: new Date(2014, 10, 1),
isInUse: true,
getProfit: function() {
return this.price - this.purchasePrice;
}
};
var propertiesForDisplayAsArray = propertyFormatter.extractPropertiesForDisplayAsArray(source);
var outputContent = "<h2>Object properties using propertyFormatter.extractPropertiesForDisplayAsArray:</h2>";
_.each(propertiesForDisplayAsArray, function(line) {
outputContent += "<br />" + line;
}, source);
var propertiesForDisplayAsString = propertyFormatter.extractPropertiesForDisplayAsString(source);
outputContent += "<h2>Object properties using propertyFormatter.extractPropertiesForDisplayAsString:</h2>" +
propertiesForDisplayAsString;
$("#output").html(outputContent);
});