Basic Algorithm Scripting - Where do I Belong

Tell us what’s happening:
Trying to print
Describe your issue in detail here.
I am trying to print out variable to check where my code is not working. When I enter, “System.out.println” I get and error reported. The error is"ReferenceError: System is not defined". How can I check for the problem if the program won’t let me inspect the items?
Your code so far

function getIndexToIns(arr, num) {
  for(let i = 0; i < arr.length; i++){
    if(arr[i] > num){
      return arr.indexOf(num);
getIndexToIns([40, 60], 50);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0

Challenge: Basic Algorithm Scripting - Where do I Belong

Link to the challenge:

this is from Java, not from JavaScript

In JavaScript you can use console.log for same purpose

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.