Like can you show me the logic on how I would implement, like a hint I don't want the answer unless I really can't figure it out. When the button is pressed a random value is returned instead of the matcing value in the array index of 5.
In order to get a specific range of values first, you need to multiply by the magnitude of the range of values you want covered. The length of the last array chunk may be less than the length of the. Notice this range does not include the 1. Math operationsIntrinsic for String operationIntrinsic for unique identifier. Questions and then attach it to the next() function as well as the randomize() and then include an if statement in next() like this Min + (int)(Math.random() ((Max - Min) + 1)) The Java Math library function Math.random() generates a double value in the range 0,1). push ( randomQuestion ) } // If the current random number already exists in the tracker, return true function existingQuestions () Īlright thank you so much, one more thing, my logic was is that if I created a variable called correctAnswer and = it to getElementById ( 'questions' ) var questions = var questionTracker = var questionAmount = 3 // Iterate however many times for ( var i = 0 i ' // Add the question to the tracker questionTracker.