Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / JavaScript Please ensure to remove all instances of the following from your final submission solution: · document

JavaScript Please ensure to remove all instances of the following from your final submission solution: · document

Sociology

JavaScript Please ensure to remove all instances of the following from your final submission solution: · document.write() · innerHTML() · alert() · any commented code ·

You should only have one console.log() per function, so any debug related console output that you may have used must be removed

· extra code (unrelated to the assignment requirement) or commented code, must be removed from your JavaScript file. ·

There should be no calls to your functions.

Our tester will call your functions based on the function names listed in main.html file. 1.

You are NOT permitted to use any external files or libraries.

Function 1: Find divisible values make a function that accepts two arguments (array and an integer number).

The function would iterate through the array to find numbers that are divisible by the number passed as second argument.

The function displays answer in console, containing the index positions of divisible elements separated by comma.

The message displayed in console should not end with comma: functionName([0, , 'k', 5, 19, 240, 99], 5); //

would produce following message in console: 3, 5

 

Function 2: Insert delimiter and join content of array as one string make a function that accepts three arguments (an array, delimiter, and a number). The function would join content of the array to form a string, inserting the delimiter after every nth element of the array and displays resulting string in console: functionName([0, 2, "Hello", 7, "TO", "---"], "+", 3); //

 

would produce following message in console: 02Hello+7TO---+

 

Function 3: Find Min and Max · Receives an integer array as argument ·

The function transverses the array to determine the minimum and maximum values in the array. ·

Displays the calculated information as illustrated below:

functionName([-8, -1, -87, -14, -81, -74, -20, -86, -61, -10]); // would produce following message in console:

The minimum value in the array is: -87, the maximum value is -1

 

Function 4: Count Occurrences · Accepts two input parameters, a string and a character letter. · The function determines the number of occurrences of the character found in the string.

Displays the result to the console as illustrated below. functionName("map", "p");

would produce following message in console:

The word map has 1 occurrences of the character p

 

Function 5: Find repeated characters make function that would accept a string and checks if any character is repeated more than once.

The function would return the repeated chars and the number of times they are repeated.

The return value is a string, all pairs separated by comma.

functionName("2abc**zac22");

//produces the following message in console: 2=3,a=2,c=2,*=2 

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions