Checking the length of strings and arrays in JavaScript

Suppose we have the variable str that stores some arbitrary string:

javascriptlet str = '12345';

Let's write a condition that will print a message to the console if the length of the string is equal to or greater than three characters:

javascriptlet str = '12345';

if (str.length >= 3) {
  console.log('!');
}
Задание 1

The variable arr contains some array with numbers. Write a condition that checks that there are 3 elements in the array. If so, print the sum of the array elements.