Skip to content

Commit f873938

Browse files
committed
toWholeNumber.js
1 parent 793ce32 commit f873938

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// 15. Convert a Float Number to Whole Number
2+
3+
function toWholeNumber(n) {
4+
// return Math.floor(n);
5+
return parseInt(n)
6+
}
7+
8+
console.log(toWholeNumber(10.5))

0 commit comments

Comments
 (0)