If statement for scene type

How do i write an "If" statement that checks what scene it is? specifically the battle scene.

Window_Message.prototype.numVisibleRows = function() {
if (???){
return 3;
} else {
return 4;
}
};
You can type:
SceneManager._scene > this will return the current scene.

But you can also type:

SceneManager._scene instanceof Scene_Battle

This will return true if you are in scene battle.
You can type:
SceneManager._scene > this will return the current scene.

But you can also type:

SceneManager._scene instanceof Scene_Battle

This will return true if you are in scene battle.

Works perfect thank you! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/if-statement-for-scene-type.121559/