Skip to content
Advertisement

How do I check if a list is empty?

For example, if passed the following:

JavaScript

How do I check to see if a is empty?

Advertisement

Answer

JavaScript

Using the implicit booleanness of the empty list is quite Pythonic.

Advertisement