Menu
CoddyTech

Recap: Introduction to Luau

Part of the Introduction To Luau section of Coddy's Lua journey. Lesson 5 of 80.

challenge icon

Challenge

Medium

Store a number id, then turn it into a string name.

  1. Declare local userId: number = 12345 and local username: string = "john_doe".
  2. Add username = tostring(userId): a string variable only takes strings.
  3. Keep the two print lines at the bottom.

Press Run Code: the output shows 12345 twice.

Try it yourself

-- 1) declare userId and username with their types
-- 2) put the id into username with tostring()

-- Print the results
print(userId)
print(username)

All lessons in Introduction To Luau

Practice on your own: Online Luau compiler