in this part, we will see how to convert other datatype to arrays and vice versa
String to Array
const str = 'abcd';
console.log(str.split('')) //output:- ['a','b','c','d']
console.log(Array.from('abcd') //output:- ['a','b','c','d']
Array to string
const arr = ['a','b','c','d'];
console.log(arr.join(''); //output:- 'abcd'
Object to Array
use Object.entries()
set to Array
Array.from(mySet)
Array to set
const mySet = new Set([1,2,3,2,3]);