How does MongoDB jump out of the forEach loop

  mongodb, question
//How do you jump out of the current cycle when the students found are older than 18?
 if(x.age > 18){
 break;  //here is a syntax error

Because forEach’s callback is a function;
Break and continue can be used within the for () loop