You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Asabeneh edited this page Nov 12, 2019
·
6 revisions
Declare firstName, lastName, age variables and assign your first name, your last name and your age to the variables.
Concatenate the firstName , a space and lastName variable and assigned to a fullName variable.
Check if your name is long or short. If the length of your first name is greater than 7, you have a long name else you have a short name
Declare an array called shoppingBasket and put at least 5 items you commonly put to your shopping basket.
Declare a function called sumOfAllNumbers, it takes a positive integer as a parameter and it returns the sum of all the numbers
Declare a function called listShoppingItems, it takes your shopping basket array you declared at question 4 as a parameter and it prints out the capitalized shopping items.
Declare a function called randomNumbers which can return an array of 7 numbers which range 1-20.
randomNumbers()[9,4,3,5,2,8,2]
Declare a function called sumOfEven, it takes a positive integer as a parameter and it returns the sum of all numbers
sumOfEven(10)
Declare an object called person, it has firstName, lastName, age, country, getPersonInfo keys. The getPersonInfo is a method which return about the person object. eg.