Question: Javascript basic function tasks I need help with: first task Write a function named returnArray that accepts 3 car makes and returns them in an
Javascript basic function tasks I need help with:
first task
Write a function named returnArray that accepts 3 car makes and returns them in an array.
Declare the array using LITERAL notation ie: not object notation. That means do not use new Array()
function returnArray(makeA, makeB, makeC){
//declare the array using LITERAL notation
//return carMakes;
}
second task
Write a function named student that has firstname, lastname and email parameters and returns an object, containing the passed parameters as properties only.
use literal notation to declare your student object.
function student(firstname, lastname, email){
//declare the student object using LITERAL notation
//return student;
}
third task
Write a function named strungOut, that takes a string and a separate substring and returns and object, called stringInfo, that contains:
a property named original containing the string
a property called caps containing the string in uppercase
a property called subIndex containing the index value of the location of the substring in the string :
function strungOut(strString, strSubString){
//declare the stringInfo object using LITERAL notation
//return stringInfo;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
