Javascript Create Nested Array Dynamically Typed Python Programming