# Error when using data tables

**URL:** https://forum.code.org/t/error-when-using-data-tables/36498
**Category:** Coding and Debugging Help
**Tags:** csp-unit-5
**Created:** [May 20, 2022, 3:06pm UTC](https://forum.code.org/t/error-when-using-data-tables/36498 "2022-05-20T15:06:00Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![jdonwells](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jdonwells/32/7900_2.png) [@jdonwells](https://forum.code.org/u/jdonwells)
#### Post date: [May 23, 2022, 11:19am UTC](https://forum.code.org/t/error-when-using-data-tables/36498/3 "2022-05-23T11:19:16Z")

</div>

> [@getColumn: one common error and one subtle error explained](https://forum.code.org/t/getcolumn-one-common-error-and-one-subtle-error-explained/34355):
>
> The most common error with getColumn by far seems to be wrapping it in []s. You end up with an array (returned by getColumn) inside an array (created by []) and that doesn’t do what you want at all. So just write var cats = getColumn("Cats","Name");. No ( )s and no []s. I wrote a more complete explanation here [Everything You Wanted to Know About App Lab Arrays, But Were Afraid to Ask](https://forum.code.org/t/everything-you-wanted-to-know-about-app-lab-arrays-but-were-afraid-to-ask/34277). The subtle error that can result is a race condition. A race condition happens when you have two or more s…

> [@Everything You Wanted to Know About App Lab Arrays, But Were Afraid to Ask](https://forum.code.org/t/everything-you-wanted-to-know-about-app-lab-arrays-but-were-afraid-to-ask/34277):
>
> Everything You Wanted to Know About Arrays, But Were Afraid to Ask. [] have two uses. One is to create an array and potentially initialize it. So for example: var a = [1,2,3]; That creates an array and assigns it to a variable. Is that variable an array now? No, it is not. Trick question. Variables don’t have types in Javascript. a is a variable that has an array value. It could just as easily hold a number or a string. Variables don’t care. I see a lot of var cats = [getColumn("Cats","Nam…

---

_[View the full topic](https://forum.code.org/t/error-when-using-data-tables/36498)._
