Course Solutions Uncategorized (Solved) : Create Program Javascript First Declare Variable Named Myarray Assign Empty Array Populate Q37707530 . . . .

(Solved) : Create Program Javascript First Declare Variable Named Myarray Assign Empty Array Populate Q37707530 . . . .

 

Create a program in javascript

  1. First, declare a variable named myArray and assign it to anempty array.
  2. Now populate myArray with two strings:
    Put your name in the first string, and “Sky” in the second.
  3. Next, declare a function named cutName. It should expect aparameter name.
  4. cutName should return an array by breaking up the input stringinto individual words.
    • Example: cutName(“Douglas Crockford”) shouldreturn [“Douglas”, “Crockford”]
    • Example: cutName(“John B. Smith”) shouldreturn [“John”, “B.”, “Smith”]
  5. Declare a new variable named myInfo and assign it to an emptyobject literal.
  6. Add the following three key-value pairs to myInfo:
    • Key: fullName
      Value: The result of calling cutName on the namestring within myArray.
    • Key: bluesky
      Value: The sky within
      OR

      PayPal Gateway not configured

      OR

      PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post