Question: JAVASCRIPT 13 ARRAY 04 A. INSTRUCTIONS SPLIT STRING TO ARRAY - RETURN VALUE FROM ARRAY OBJECTIVE Practice creating and using arrays. In E-BOOK SEARCH FOR

JAVASCRIPT 13 ARRAY 04

A. INSTRUCTIONS

SPLIT STRING TO ARRAY - RETURN VALUE FROM ARRAY

OBJECTIVE

Practice creating and using arrays.

In E-BOOK SEARCH FOR AND READ

split <== This is what this assignment is about. Search for this and read carefully and completely.

delimiter

arrays

get value from array

do not change parameter values

parameter <== This has an important reminder about never changing parameter values

return value from delimited data <== This has a full example for you to study. READ THIS!

NOTICE

These instructions are deliberately brief. The intent here is to allow you to demonstrate what problem solving and programming skills you have mastered.

You can do this in 2 or 3 lines of code. No loop is used here.

CREATE javascript 13 array 04.js (there is no HTML page)

DO THIS

1. Create javascript 13 array 04.js with a general function: animal() with three parameters:

delimiter

data (this is a delimited list of animals)

arrayIndex

All three parameters must be used in your function. Did you search for and read in e-book: do not change parameter values

2. The function will do this:

a. Split data into an array.

b. Return the array value at position arrayIndex.

TIPS

Do not give the parameters values. Use all three parameters.

If you want to test: After the end of your function, after }; use alert(animal(a,b,c)) where a,b and c are legitimate parameter values. If you do this:

The first two values are strings so you need quotes. The 3rd is a number.

Click GO to test.

Remove this alert() after you test before you GRADE.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!