What is the script line to optimize equips in an auto event?

$game_actors[1].optimize_equipments


This was used in RPG Maker VX Ace.  What is it for MV?  Or is it the same.  Cause I tried using it and


this pops up on the screen:


ReferenceError


$game_actors is not defined.


And I apologize if this has already been answered.
Code:
$gameActors.actor(actorId).optimizeEquipments();
Alright!  Thanks.
$gameActors.actor(actorId).optimizeEquipments();


Can you give me a better Idea how to use it please?

Original thread: https://forums.rpgmakerweb.com/threads/what-is-the-script-line-to-optimize-equips-in-an-auto-event.55332/