Javascript function to count rows in table

Hi all, This one seems pretty simple but it's escaping me. Does anyone know how to return the count of the number of rows in a table / pivot table in knack in Javascript?

Basically I'm not sure how to reference a specific table in something like this

var totalRowCount = table.rows.length;

The answer is probably in here from the dev docs - but I'm a novice and the syntax is evading me. Thanks!

/* Change the scene_1 to the scene key of your choice, or replace with any to work on all pages. */
$(document).on('knack-scene-render.scene_1', function(event, scene) {
  // Loop through each scene view, on the page. {
    // If view has row data and that data is less than 1...
    if(Knack.models[view.key] && Knack.models[view.key].data && Knack.models[view.key].data.length < 1) {
      // Remove the specific view.
        $('#' + view.key).remove();