Why does the script editor not like this?

Since a recent update the script editor has been underlining code like this

table.insert(alerts, #alerts + 1, alert)

in red. It still works, but it is acting like it shouldn’t by underlining it. Is it being deprecated or something?
Screenshot 2021-08-02 133756

1 Like

It’s simply due to the second argument being not that useful.

table.insert(alerts, alert)

Will behave the same way
(also because of efficiency, since getting the length of the table makes it slower)

1 Like

So if you leave the number position out of a table.insert it automatically adds it to the table like this #table + 1?

1 Like