The below finds my layer and shows visible property in the console, when I toggle it there from 'true' or 'false' it changes.
<SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">myApp</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">mapview</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">map</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">findLayerById</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">(</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">'cool_layer'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">);</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;"> </SPAN>

But when I run the below line, I can toggle my layers on or off individually, but how could I loop through all of them, and turn them all off? I am trying tocreate a 'reset' button.
<SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">myApp</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">mapview</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">map</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">findLayerById</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">(</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">'cool_layer'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">).</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">visible </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">true</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px; padding: 0px;">;</SPAN>