DEV Community

Cover image for Understanding the difference between Javascript Arrays and python lists.
Kent
Kent

Posted on

Understanding the difference between Javascript Arrays and python lists.

Understanding the difference between Javascript Arrays and python list

JavaScript arrays and python lists stores any type of element, data types, and other arrays. the difference here is using python to store elements/data types that are of the same type.

JavaScript arrays are resized when you add or remove items while you will have a hard time dealing with large lists with python.

JavaScript arrays can have gaps between the indexes where there are no elements. Python lists have memory allocations that are in order for elements.

Knowing this little differences can help you choose the right data structure for your needs and keep your codes simple.

Top comments (0)