Challenge 23
🔢
Is Integer?
Create a function which takes in a number as a parameter and returns whether it is an integer or not
Examples:
isInteger(4) returns true
isInteger(4 ** 2) returns true
isInteger(4.1) returns false
Extension:
Output the magnitude away from the closest integer the real part of the number is - e.g. 4.1 could output "4.1 is 0.1 away from 4", while 4.7 would output "4.7 is 0.3 away from 5". This should also work for negative numbers too