Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Write a JavaScript function variablesTypes(arr) that accepts the following parameters:
- name, age, isMale (true or false), array of your favorite foods. The function must return
- the values of the variables and their types. */
- "use strict";
- function variablesTypes(arr) {
- console.log('"My name: ' + arr[0] + ' //type is ' + typeof (arr[0]));
- console.log('My age: ' + arr[1] + ' //type is ' + typeof (arr[1]));
- console.log('I am male: ' + arr[2] + ' //type is ' + typeof (arr[2]));
- console.log('My favorite foods are: ' + arr[3]);
- console.log('//type is ' + typeof (arr[3]) + '"');
- }
- variablesTypes(['Pesho', 22, true, ['fries', 'banana', 'cake']]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement