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.
Array creation
The from() method
Report a typo
Sample Input 1:
Hello JS ArraysSample Output 1:
[
'H', 'e', 'l', 'l',
'o', ' ', 'J', 'S',
' ', 'A', 'r', 'r',
'a', 'y', 's'
]Write a program in JavaScript
function getArrayWithLength(string) {
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.