fac-15 / Who-am-I-API

0 stars 0 forks source link

Try and be consistent if using let and const! #32

Open developess opened 6 years ago

developess commented 6 years ago

https://github.com/fac-15/Who-am-I-API/blob/a58f145c0684e6d1f428e2bafe8391aa9d9a1dd8/hp/hp.js#L50-L58

Try to avoid using a mixture of let/const and var!

Also - this would be much better if it was encapsulated into a function

  const getIndexFromName = (string) => {
    // ... your code here
    return n
  }
  let index = getIndexFromName("developess")