tables doc by a-m-lamb · Pull Request #3239 · Codecademy/docs (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation33 Commits9 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Description
Type of Change
- Adding a new entry
- Updating the documentation
Checklist
- All writings are my own.
- My entry follows the Codecademy Docs style guide.
- My changes generate no new warnings.
- I have performed a self-review of my own writing and code.
- I have checked my entry and corrected any misspellings.
- I have made corresponding changes to the documentation if needed.
- I have confirmed my changes are not being pushed from my forked
main
branch. - I have confirmed that I'm pushing from a new branch named after the changes I'm making.
- Under "Development" on the right, I have linked any issues that are relevant to this PR (write "Closes # in the "Description" above).
All committers have signed the CLA.
@@ -0,0 +1,76 @@ |
---|
--- |
Title: 'Tables' |
Description: 'luau is a scripting language particularly for Roblox game development. This document is meant to demonstrate the use case for luau tables.' |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[proofreading] Consider briefly defining tables as opposed to luau. It'll help make the entry more cohesive.
Description: 'luau is a scripting language particularly for Roblox game development. This document is meant to demonstrate the use case for luau tables.' |
---|
Description: 'In the context of luau and Roblox, tables are data types that can store any types of value.' |
local table = {} |
---|
``` |
In the context of Lua, the local keyword is primarily used to declare local variables. It is not used specifically for instantiating tables. You can use the local keyword to create local variables of various types, including tables, numbers, strings, functions, and more. What creates the table is the curly braces in the syntax ({}). If you wanted to instantiate a table with parameters you can write something like this: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[proofreading] Since tables are being discussed in a Luau context, consider using that instead of Lua. Also, hyperlink the word to help readers see the connection more.
In the context of Lua, the local keyword is primarily used to declare local variables. It is not used specifically for instantiating tables. You can use the local keyword to create local variables of various types, including tables, numbers, strings, functions, and more. What creates the table is the curly braces in the syntax ({}). If you wanted to instantiate a table with parameters you can write something like this: |
---|
In the context of [Luau](https://www.codecademy.com/resources/docs/luau), the local keyword is primarily used to declare local variables. It is not used specifically for instantiating tables. You can use the local keyword to create local variables of various types, including tables, numbers, strings, functions, and more. What creates the table is the curly braces in the syntax ({}). If you want to instantiate a table with parameters you can write something like this: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, good point
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @a-m-lamb! :) Your PR is off to a great start! :) I just gave some tips on how you can improve it.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made another suggestion.
### Accessing Items |
---|
If your table is set up like an array, an important thing to note is that the index begins at 1 rather than at 0 as it is for other languages. Let's use this table as an example: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. I'm not seeing a path for dictionary documentation. Does that not exist yet? lol Should I just create a hyperlink for each datatype?
SSwiniarski linked an issue
that may beclosed by this pull request
3 tasks
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @a-m-lamb! :) Now you just a review from @SSwiniarski and then another review from a different maintainer.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@a-m-lamb I've completed my initial review. Please update the entry, and tag me when you've finished making changes. Thanks
Calling items from a table when it's formatted like a dictionary is a little different. You can get the value of items by the keys. Below is an example of how you can get the username value from the profile table. |
---|
``` |
//creating the profile table |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code blocks should use 2 spaces for indentations, not tabs. Comments should have a space and begin with a capital -
// Printing the username in the table
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I do agree
Co-authored-by: caupolicandiaz caupolicandiaz@gmail.com
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@a-m-lamb For the sake of moving this entry along I went ahead and made the changes directly. This is ready for a second review.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @a-m-lamb
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!
🎉 Your contribution(s) can be seen here:
https://www.codecademy.com/resources/docs/luau/tables
Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, see here.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree
Calling items from a table when it's formatted like a dictionary is a little different. You can get the value of items by the keys. Below is an example of how you can get the username value from the profile table. |
---|
``` |
//creating the profile table |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I do agree
Reviewers
Letsgoque Letsgoque left review comments
caupolicandiaz caupolicandiaz approved these changes
SSwiniarski SSwiniarski approved these changes
CBID2 CBID2 approved these changes
KTom101 Awaiting requested review from KTom101
yangc95 Awaiting requested review from yangc95