Arrow function to square a number

Report a typo

Create an arrow function that takes a single number as input and returns the square of that number. The input will be a single integer on a line. Print the squared result.

Sample Input 1:

5

Sample Output 1:

25

Sample Input 2:

0

Sample Output 2:

0
Write a program in JavaScript
// Write an arrow function named `square` that takes `num` as input
// and returns the square of `num`
const square =

console.log(square(num));

Create a free account to access the full topic