Skip to content

Instantly share code, notes, and snippets.

@Arieg419
Created December 22, 2016 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arieg419/ce4079e50c73a53fa4732362ef0dcd6a to your computer and use it in GitHub Desktop.
Save Arieg419/ce4079e50c73a53fa4732362ef0dcd6a to your computer and use it in GitHub Desktop.
/*
The following is a "driver" file for your TempTracker.js class.
The TempTrackers class you are creating should support all of these methods,
and return the values commented out, at the end of every console.log function call.
*/
var tmp = new tempTracker();
tmp.insert(1);
tmp.insert(2);
tmp.insert(3);
tmp.insert(4);
tmp.insert(5);
tmp.insert(6);
tmp.insert(13);
tmp.insert(13);
tmp.insert(13);
tmp.insert(13);
tmp.insert(13);
tmp.insert(13);
var res = tmp.getMean();
console.log(res); // 8.25
res = tmp.getMode();
console.log(res); // 13
res = tmp.getMax();
console.log(res); // 13
res = tmp.getMin();
console.log(res); // 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment