Transfer practice · Create a table with keys = 0 and no maps field. Display keys then maps. Expect numeric 0, then nil.
Use a familiar idea in a different task. Read the changed requirement before running.
Create a table with keys = 0 and no maps field. Display keys then maps. Expect numeric 0, then nil.
0 nil
Lines must stay in order. Spelling, capitalization and spaces inside a message matter.
local stock = { keys = 0 }
print(stock.maps)There is no maps entry, so its value is nil.
New syntax: nil
This table has bolts but no lamps field. print(stock.lamps) displays nil. Adding lamps = 0 creates a field with a numeric value of zero.
Select a word or symbol in this authored example. Your editor draft stays unchanged.
stock bolts 3
stock.lampsThis is a private experiment copy. It does not replace your answer or complete the activity.
Your output will appear here.
Replace this code with the starter? Download your draft to keep a copy.
Your output will appear here.
Sign in with RoCreators to save private progress across devices. Community verification is separate.