Objective

Given an array holding grocery items, create an HTML <ol> list using it.

Difficulty

Easy

Description

Programmers love programming, isn't that so? One programmer has particularly written a list of grocery items in an array.

Here's that array:

var items = [
   'Oranges',
   'Oregano',
   'Mozzarella cheese',
   'Milk',
   'Detergent powder'
];

Your job is to take this array and write some additional code to print out an HTML <ol> list using its elements.

Note that you must NOT use a for or while loop, but rather accomplish this task solely using array methods. For the output, you should use document.write().

Here's the expected output:

  1. Oranges
  2. Oregano
  3. Mozzarella cheese
  4. Milk
  5. Detergent powder

Hints