Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update numberRounding.js
changed calculating to Math.max to find highest.
  • Loading branch information
heartwhite authored May 1, 2019
commit 5ee2deb1c86fe6b82beba0913b26b5b138cc9ca1
9 changes: 7 additions & 2 deletions Week1/numberRounding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ console.log(z);
let a = Math.round(z);
console.log(a);
let numbers = [a, z];
numbers.sort(function(a, b) { return b - a; });
let highNumber=(Math.max(z,a));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.

console.log(highNumber);


/* ----this is what i found first---
numbers.sort(function(a, b) { return b - a; });
var highest = numbers[0];
console.log(highest);
console.log(highest);
*/