221k views
5 votes
After the code that follows is executed, the variable named userEntry will contain:

var userEntry = 461.95;
userEntry = parseInt(userEntry);
a) cannot tell
b) 461
c) 461.95
d) 462

User PurTahan
by
9.1k points

1 Answer

4 votes

Final answer:

The variable named userEntry will contain the integer value 461.

Step-by-step explanation:

After executing the code, the variable named userEntry will contain the integer value 461. This is because the parseInt() function in JavaScript converts a given value to an integer by removing any decimal places and only considering the whole number part.

User Keneth Adrian
by
8.5k points