Skip to content
Discussion options

You must be logged in to vote

Calling the function in 2 should return a value - you do not return anything, instead you push to the timeline.

Two options:

      function make_block(block_number, trial, n) {
        temp_timeline = []
        for (let trial = 1; trial < n + 1; trial++) {
          console.log({ trial });
          temp_timeline.push(make_trial(block_number, trial));
          temp_timeline.push(pause)
        }
        // note that because this will be added to the main timeline later, this needs to be return like a timeline object, not array
        return {timeline: temp_timeline}
      }

timeline.push(make_block(block_number, trial, n))
timeline.push(pause)

or

      function make_block(block_number, 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@letitiayhho
Comment options

Answer selected by letitiayhho
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants