Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Computing Term;-;, Can anyone help me 1 more time????

Asked by 5 years ago

" indexing tables with integers", i see this term in programming lua edition I, what does "index" meaning?

1 answer

Log in to vote
3
Answered by 5 years ago

'Index' is a term referring to the location of a value in a table.

When you create a table like this

local table = {}
table[1] = "Hello"
table[2] = "World"

"Hello" is stored at index 1

"World" is stored at index 2

This is an example of 'indexing tables with integers' as the indexes we are using to store the two strings are.. integers!

Index simply refers to the 'key' we use the access the 'value' in the table. In Lua, we aren't limited to just using integers as keys. We can use (pretty much) anything, including strings, doubles, instances, and even other tables.

Hope this helps :)

0
0H yeah, i can easily understand this, thanks a lot for the answer :) Creeperdo123 -17 — 5y
0
I wrote this answer into my notebook :) Creeperdo123 -17 — 5y
Ad

Answer this question