I stumbled upon this 7-minute video about objects in Javascript on YouTube:
While watching it, I realized how funny it was that similar-looking data types were called different things in different programming languages.
example = [1, 2, 3, 4]
In Javascript, this is called an array. In Python, it’s called a list.
example = {
'protagonist': 'Harry Potter',
'nemesis': 'Voldemort',
'antagonist': 'Draco Malfoy'
}
In Javascript, this is called an object. In Python, this is called a dictionary.
If you’re switching from either language for the first time, don’t get tripped up!