The from() method

Report a typo

The below getArrayWithLength function accepts a string argument. Complete the function to create and return a new array from the given string using the from() method.

Sample Input 1:

Hello JS Arrays

Sample Output 1:

[
  'H', 'e', 'l', 'l',
  'o', ' ', 'J', 'S',
  ' ', 'A', 'r', 'r',
  'a', 'y', 's'
]
Write a program in JavaScript
function getArrayWithLength(string) {

}
___

Create a free account to access the full topic