I am stuck on my Intro to Javascript lesson :(

Hello,
I was breezing through my first lesson until I got to the portion “INTRODUCTION TO JAVASCRIPT
Built-in Objects” with the decimal calculations. I honestly have no idea what this question is asking and I can’t figure it out:

3.

Find a method on the JavaScript Math object that returns the smallest integer greater than or equal to a decimal number.

Use this method with the number 43.8 . Log the answer to the console.

Can someone please assist me so that I understand this concept? Thanks a lot

Two Math methods return integers… .floor() and .ceil(). Read up on those two.

1 Like

I am still confused because I don’t understand what it’s asking. When you said this, I thought maybe I needed to Math.floor(.ceil(43.8)); but I am lost again. Can you throw me another bone? Thanks for the reply!!

Wow, I feel silly. console.log(Math.ceil(43.8)); was it, so I had the right idea. Thanks again :slight_smile:

2 Likes

Remember to read and re-read any documentation pointed to in lesson narratives. Be sure to go back and review. There is always some small detail that can be picked up, especially if we try some variations and study their outcomes. It is only through repetition that any of the material will stick. Practice, practice, practice, and don’t move on until you are sure you have covered the lesson fully.

2 Likes

Solution:

console.log(Math.ceil(43.8));