array in array code example
Example 1: java string array
String[] arr = new String[5]
arr[0] = "Happy";
arr[1] = "Birthday";
arr[2] = "To";
Example 2: javascript element in array
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var n = fruits.includes("Mango");
Example 3: javascript array
var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
Example 4: how to make an array in javascript
var names = ["Sanjith", "Pranav", "Aadya", "Saharsh"]
Example 5: java array
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int newarr[] = new int[maxSize];
newarr[pos] = n;
for (i = 0; i < maxSize; i++) { newarr[i] = arr[i]; }
Example 6: js in_array
var a = [1, 2, 3];
a.includes(2);
a.includes(4);