Data Structures
Comparing data structure differences between Python and JavaScript
The information comes from the Udemy course "Become an AI Engineer: Python for JavaScript Developers" by Vilva Athiban
| Feature | JavaScript | Python |
|---|---|---|
| Arrays / Lists |
|
|
| Slicing |
|
|
| indexOf / includes |
|
|
| Negative Indexing |
|
|
| Copy (Spread Operator) |
|
|
| dictionaries - objects |
console.log(obj.e); // undefined (missing key -> undefined)
console.log(obj["a"]); // 1 (dot or bracket access)
|
|
| entries - items |
|
|
| Tuples - (immutable — Python-specific) |
|