0

JavaScript Arrays with Elements of Different Data Types

Background

Array with different types of data? Weird stuff! Generally, an array is collection of similar items. In Computer Science 101, this means the items are of the same data type. We have an array of integers, boolean values or strings. But in JavaScript, arrays can have elements of different types.

JavaScript Codes

Outputs:

Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert