100 JS Functions

Beginner

1. CurrentYear

2. SimpleCounter

3. DoubleNumber

4. CreateColor

5. DynamicGrid

6. DynamicPictureSize

7. RandomButton

8. TabbedNavigation

9. MathOperator

10. GuessTheNumber

11. BetweenDates

12. Reactions

13. FeedTheBunny

14. Countdown

15. ClickFast

16. SkillsForJobs

17. UsersTabel

18. TodoList

19. UserSearch

20. SpendingInfo

3.DoubleNumber

Write a component named <DoubleNumber> that has an input that accepts numbers.

When changing the value inside the input, its doubled value will appear underneath.

The component should render:

  • 1 input;
  • a paragraph with the doubled value. If there's no value in the input, this should render Value is 0.

For example: when you enter “1” in the input field, the value shown below changes to “2”. If you then append a “0” (making the input “10”), the value underneath updates to “20”.

Example 1

Input

No input props

Demo

Open demo in new window

You'll see test results here!