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.
Arrow functions
Arrow function to square a number
Report a typo
Sample Input 1:
5Sample Output 1:
25Sample Input 2:
0Sample Output 2:
0Write 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
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.