arrays

  1. jaredcb

    JavaScript Getting the sum of equal array elements, and creating a new array

    I'm scratching my head over this one. Not sure if I'm asking this question wrong, but I'm trying to reach out where I can hopefully find someone who knows what I can try. I tried asking this on another forum, and they didn't like that I didn't have any example of failed code yet, so they...
  2. T

    JavaScript Creating a new array from recursive mapping

    I am attempting to do something very complex. I have a database that has a self relation (categories that contain a nested category). The ORM I’m using makes use of these categories as objects: category = [ { name: "Lights", description: "some description", parentid: "some id"...
  3. E

    JavaScript Can someone explain why I'm getting zeros in my missed_questions array?

    Here's the javascript code I did, public class SamDriverExam { private char []exam_answer_key = {'B','D','A','A','C','A','B','A','C','D','B','C','D','A','D','C','C','B','D','A'}; private char []student_answer; public SamDriverExam(char []exam_answers) {...
  4. P

    JavaScript How do I loop through an array and display each item in the HTML page on a new line?

    Hi, I am new to JS from Python. I am trying to create a To Do List in JS, and I am trying to loop over an array that contains the added items. I want each item in the array to appear on a new line in the web app. The best I can get is for the items to be displayed like this item1,item2,item3 I...
  5. S

    JavaScript querySelector works, but not querSelectorAll

    I want to replace all .emoji elements, with a random weather emoji. I have written the following code to randomize an emoji: let weatherEmojis = [ "⚡️","☀️","⛅️","☁️","💧","💦","☔️","💨","❄️" ]; var weatherEmoji = weatherEmojis[Math.floor(Math.random() * weatherEmojis.length)]; And the...
  6. N

    JavaScript get max sum of multiple functions

    I'm trying to get the largest number of this 3 functions then store in an array, the variables of that function and their amount..can be done? //this must be the result var result = [50,55,60,165] // function r2 function r1(){ var x = 5; var a = 10; var b = 10; return x+a+b // 25 } function...
  7. Sidddharth

    JavaScript Script to find the number from table and store the index into variable.

    Hello Everyone, I want to take input from user and on basis of the input i want to show the correct value of it. For example if user enters number 5. The correct value from the below table i.e. 1 should be displayed. Table 1 Input Value 0-5 1 6-10 2 11-15 3 16-20...
  8. datastructures

    Visualizing arrays with a basic computing problem

    I have something that has been bugging me for a while now. From the wikipedia entry on arrays This is the wikipedia page https://en.wikipedia.org/wiki/Array_data_structure. Take a simple mysql table with the following fields The table has products in it and i want to query this table and...
  9. M

    Increment of arrays

    I am struggling with the difference in array incrementation. For example if I had an array. char* arr = ["a", "b", "c", "d", "e", "f"] and if given arr[0] then the element that it is reffering to is "a", and arr[i +2] is "c". But if the incrementation was arr[i]+2, then what is the element is it...
  10. TechnicalTobi

    C Why is fread and fwrite giving error 'containing too many arguments'?

    I am working on a project in which data from .bin file have to be transferred to .csv . The data consists of many points each containing 4 values in varying dataformats, them being Time stamp, Pressure, System state and Alarm state. Unfortunately the same error, being 'too many arguments to...
Top Bottom