in JavaScript - Create a function titled "counter" that takes an array of numbers as the parameter. The function is then to return an array holding the numbers of negative elements, zeros, and values greater than zero in the given array parameter.
Please do comment if you have any doubt regarding this program
Program ScreenShot:


Sample Output:

Program Code:
<!DOCTYPE html>
<html>
<head>
<title>Array numbers</title>
</head>
<body>
<!-- paragraphs to display the elements count
-->
<p id = "arraynumbers"></p>
<p id = "negitivenumbers"></p>
<p id = "positivenumbers"></p>
<p id = "zeronumbers"></p>
<!-- JavaScript Code -->
<script>
// decalre and initialize an
array
array = [2, 0, -1, 6, 10, -6,
3];
// display the array in the id =
arraynumbers paragraph
document.getElementById("arraynumbers").innerHTML = "The array
numbers are " + array
// decalre and initialize the
countes for postive negitive and zero elements
var negitiveCounter = 0,
positiveCounter = 0, zeroCounter = 0;
// Lopp through array length
for(var i = 0; i < array.length
; i++){
// if number is
negitive increase negitiveCounter count
if(array[i] <
0 ){
negitiveCounter++;
}
// if number is
positive increase negitiveCounter count
else if(array[i]
> 0){
positiveCounter++
}
// if number is
zero increase zeroCounter count
else{
zeroCounter++;
}
}
// display the negitivenumbers
count in the id = negitivenumbers paragraph
document.getElementById("negitivenumbers").innerHTML = "The numbers
of negative elements in array : " +negitiveCounter
// display the positivenumbers
count in the id = positivenumbers paragraph
document.getElementById("positivenumbers").innerHTML = "The numbers
of Positive elements in array : " +positiveCounter
// display the zeronumbers count in
the id = zeronumbers paragraph
document.getElementById("zeronumbers").innerHTML = "The numbers of
zero elements in array : " +zeroCounter
</script>
</body>
</html>
in JavaScript - Create a function titled "counter" that takes an array of numbers as the...
create a javascript function named sumBeyond that takes in an array of numbers and returns the summation of the values in the array that are greater than (but not including) 42. If there are no values greater than 42, the function should return 0. example- sumBeyond([2,85,932,0,7,-5,0,32]) must return 1017
create a javascript function named bbqFood that takes in an object and returns an array. The input object will have strings naming party foods as the key and the numbers of people that each key will feed as its values. return an array containing all of the keys whose values are greater than 10, menaing it will feed more than 10 people. example bbqfood(['taco':15, 'hamburger':6,'pasta':42,'fruit':23}) must return ['taco','pasta','fruit']
Create a function in JavaScript called "sum" that takes in an array as a parameter and returns the sum of all of the EVEN numbers in a given array. Please note: the array passed in can have any data type, i.e. Strings, Numbers, Booleans, undefined, etc. HINT: the expression typeof will help discern var types. For example if I have: var x = 4, and I do typeof(x) - the output would be "Number" Example run: sum([1, 4, 8, 10,...
Javascript function that takes an array parameter and returns an array value. The assumption is that the array is an integer array. The returned array should be composed of the square of the elements in the array parameter for the corresponding position.
JavaScript Write a function named "sort_by_length" that takes a list/array of strings as a parameter and sorts the strings by their length
in javascript Write a function named "sort_by_average_rating" that takes a list/array of key-value stores as a parameter where each key-value store has keys "ratings", "budget", and "box_office" where budget and box_office are integers and ratings is a list of integers. Sort the input based on the average of the values in "ratings"
Write a function called
addNeighbors that takes an array of numbers and adds each number in
the array to the number next to it. The array will always have an
even number of numbers in it. In the end you should return an array
of neighbors added up. Please use JavaScript
Instructions from your teacher. Medium Question #4 Write a function called addNeighbors that takes an array of numbers and adds each number in the array to the number next...
In Javascript Define 2 functions in JSBin: - A function which receives an array of numbers as an argument, and returns the product of all the numbers in that array. For example, multiply([2,3,4]) should return 24. - A function which receives a string as an argument, and returns the reversal of that string. For example, reverse('Hello there!') should return "!ereht olleH"
-Create a function output() in C that takes the pointer to the array and its size and prints the arrays' contests. (malloc format) (function prototype : void output(int *arrayPtr, int size); -Create a function check() in C that takes the pointer to the array and a number and checks if the number is in the array. If the number is in the array, returns the index of the element of the array holding the number. Otherwise, returns -1.
Use Java or Javascript to slve
1. Given an array of numbers, write a function to return an array of numbers' where productsli] is the Input: [1, 2, 3,4, 5] Output: [(2*3*4*5), (1 3*4*5), (1*2*4*5), (1*2*3*5), (1*2*3*4)1 [120, 60, 40, 30, 24] You should do this in O(N) without using division.