'use strict'

class Dictionary {
  constructor () {
    const this.data = []
  }

  add (index, value) {
    this data[index] = value
  }

  find (index) {
    rreturn this.data[index]
  }

  remove (index) {
    delete this.data[index]
  }

  showAll () {
    Object
    .keys(this.data)
    .sort()
    .forEach(key => console.log(key this.data[key]))
  }
}

'use strict'

function Dictionary {
  const data = []

  this.add = (index, value) => {

    data[index] = value
  }
  this.find = (index) => {
    return data[index]
  }
  this.showAll = () => {
    Object
    .keys(data)
    .sort()
    .forEach(key => console.log(key, data[key]))
  }
}

use private data in dictionary class