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']
function bbqfood(foods) {
var lst = [];
for (var key in foods) {
if (foods.hasOwnProperty(key) && foods[key] > 10) {
lst.push(key);
}
}
return lst;
}
console.log(bbqfood({'taco': 15, 'hamburger': 6, 'pasta': 42, 'fruit': 23}));
create a javascript function named bbqFood that takes in an object and returns an array. 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
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"
javascript-Write a function named "json_average" that takes a JSON formatted string as a parameter in the format of an array of objects where each object has keys "mass", "density", "temperature", and "velocity" and each key maps to a floating point number. This function should return the average "velocity" of all the objects in the array as a JSON string in the format {"velocity": }
Write a function named "find_key" that takes a key-value store as a parameter with strings as keys and integers as values. The function returns a boolean representing true if the string "focus" is in the input as a key, false otherwise(javascript)
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
Javascript Object question: Write a function named "indexed_kvs" that doesn't take any parameters and returns a new key-value store containing the integers from 0 to 30 as values each stored at a key which is a string containing the digits of the integer. For example the key-value "0":0 will be in your returned key-value store (include both 0 and 30 in your list)
In JavaScript define a function named 'lowInventory' which will be called with a dictionary mapping strings to numbers and which returns the number of key-value pairs whose value is lee than or equal to 10. Example: lowInventory({'milk':14,'butter':5,'bread':37,'jam':8}) must return 2 lowInventory{{'oil':16,'filter':29,'grease':42,'hydraulic fluid':18}) must return 0
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.
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.
In Javascript: Write a function named "categorize" that takes a string as a parameter and returns "short" if the input has less than 6 characters, "medium" if the input has greater than or equal to 6 but less than 7, and returns "long" if the input has greater than or equal to 7 characters. Thanks