Skip to content

Instantly share code, notes, and snippets.

@kironroy
Last active May 5, 2023 01:28
Show Gist options
  • Save kironroy/011f183bdc1d4c9ef7cbbbb400049641 to your computer and use it in GitHub Desktop.
Save kironroy/011f183bdc1d4c9ef7cbbbb400049641 to your computer and use it in GitHub Desktop.
for loop js
const ginaArr = [
'Gina',
'Davis',
2037 - 1967,
'singer',
['Sam', 'Tam', 'Mam'],
true
];
const types = [];
// reading from array
for (let i = 0; i < ginaArr.length; i++) {
console.log(ginaArr[i], typeof ginaArr[i]);
// filling types of array
// types[i] = typeof ginaArr[i];
types.push(typeof ginaArr[i]);
}
console.log(types);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment