-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.js
21 lines (15 loc) · 1.25 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$(document).ready(function() {
var outputContent = "Bicycles sorted by rent price: <ul><li>" + bicycleTransformer.getBicyclesSortedByRentPrice().join('</li><li>') + "</li></ul>";
var bicyclesGroupedByYear = bicycleTransformer.getBicyclesGroupedByYear();
outputContent += "Bicycles grouped by year 2014: <ul><li>" + _.pluck(bicyclesGroupedByYear["2014"], 'name').join('</li><li>') + "</li></ul>";
outputContent += "Bicycles grouped by year 2015: <ul><li>" + _.pluck(bicyclesGroupedByYear["2015"], 'name').join('</li><li>') + "</li></ul>";
var bicyclesGroupedByPrice = bicycleTransformer.getBicyclesGroupedByPrice();
outputContent += "Bicycles grouped by lowest price: <ul><li>" + _.pluck(bicyclesGroupedByPrice["10"], 'name').join('</li><li>') + "</li></ul>";
var bicyclesIndexedById = bicycleTransformer.getBicyclesIndexedById();
outputContent += "Bicycles indexes by id: <ul><li>" + _.pluck(bicyclesIndexedById, 'id').join('</li><li>') + "</li></ul>";
var bicyclesCountByType = bicycleTransformer.getBicyclesCountByType();
outputContent += "Bicycles count by type: <br/>" + propertyFormatter.extractPropertiesForDisplayAsString(bicyclesCountByType, true);
$("#output").html(
"<h2>Transformations with bicycles:</h2>" +
outputContent);
});