fork download
  1. let myString = 'Ryu+Ken+Chun-Li+Cammy+Guile+Sakura+Sagat+Juri';
  2. let myArray = myString.split('+');
  3. let arrayLength = myArray.length;
  4. let lastItem = myArray[arrayLength - 1];
  5. // Don't edit the code below here!
  6.  
  7. section.innerHTML = ' ';
  8. let para1 = document.createElement('p');
  9. para1.textContent = `Array: ${ myArray }`;
  10.  
  11. let para2 = document.createElement('p');
  12. para2.textContent = `The length of the array is ${ arrayLength }.`;
  13.  
  14. let para3 = document.createElement('p');
  15. para3.textContent = `The last item in the array is "${ lastItem }".`;
  16.  
  17. section.appendChild(para1);
  18. section.appendChild(para2);
  19. section.appendChild(para3);
  20.  
Runtime error #stdin #stdout #stderr 0.04s 17220KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:7:1 ReferenceError: section is not defined
Stack:
  @prog.js:7:1