The approach for this kind of question would be to traverse the binary tree in level order traversal(breadth first search) and then find the maximum for each level. The level-order traversal needs to be modified so that nodes on each level can be iterated.

In this case, there are two loops in 'findMaxEveryLevel' function. The outer loop keeps track of the number of nodes in the 'queue' using 'nodeCount' variable which represents the number of nodes in the current level. The inner loop iterates over each node in the current level and calculates the maximum for that level. Finally, once the inner loop is complete the outer loop logs the maximum value in the current level of the binary tree and sets the 'max' variable to be 'Number.MIN_VALUE'. This goes on for each level of the binary tree until the last level.

• Time Complexity: O(n), Because the function visits each node in the binary tree only once.
• Space Complexity: O(n), Because in the worst case the queue can take-up the same space as the number of nodes.
Where n is the total number of nodes in the binary tree.

```class Node{
constructor(val){
this.val = val;
this.left = null;
this.right = null;
}
}

let findMaxEveryLevel = (root)=>{
let queue = new Queue();
let nodeCount = 0;
let max = Number.MIN_VALUE;
queue.push(root);

while(true){

nodeCount = queue.size();

if(nodeCount === 0){
break;
}

while(nodeCount>0){

let currentNode = queue.pop();//same as polling a queue

console.log(currentNode.val);//bfs output

if(currentNode.left!==null){
queue.push(currentNode.left);
}

if(currentNode.right!==null){
queue.push(currentNode.right);
}

max = Math.max(currentNode.val, max);
nodeCount--;
}

console.log(`Max for current level: \${max} \n`);
max = Number.MIN_VALUE;
}
};
```

This is a queue helper class that we use to guarantee O(1) time complexity for push, pop, peek and empty methods.

```class LinkedListNode {
constructor(val) {
this.val = val;
this.next = null;
}
}

class Queue {

constructor(){
this.tail = null;
this.queueSize = 0;
}

push(val){
if(this.tail === null && this.head === null){
}else{
this.tail.next = newNode;
this.tail = this.tail.next;
}
this.queueSize++;
}

pop(){
}
this.queueSize--;
return result;
}
return null;
}

size(){
return this.queueSize;
}

peek(){