JavaScript Using `Map` how do I write a function that converts an array of farenheit values to celcius? using mind map to write a book

I'm am very new to programming and I am trying to solve a problem where I have to convert an array of Fahrenheit values, to Celsius. Though I am not too sure where to start with .map and I would really appreciate some help in understanding how to solve this problem.

This was my first attempt in trying to solve the test problem.

function convertTemps(array) {
  return array * (9/5) + 32
}

These are the problems I am trying to solve

describe('convertTemps', () => {
  it('should convert farenheit to celcius for all temperatures in the array', () => {
    expect(convertTemps([23, 140, 212, 41])).to.deep.equal([-5, 60, 100, 5])
    expect(convertTemps([-58, -22, -4, 14])).to.deep.equal([-50, -30, -20, -10])
    expect(convertTemps([104, 122, 158, 176])).to.deep.equal([40, 50, 70, 80])
  })
})
Answer:1

If you can use es6 (arrow functions)

function convertTemps(array) {
    return array.map(element => element * (9/5) + 32);
}
Answer:2

I am trying to set up the following architecture: a core React application that gets built with some basic functionality, and the ability to load additional React components at runtime. These ...

I am trying to set up the following architecture: a core React application that gets built with some basic functionality, and the ability to load additional React components at runtime. These ...

I have a chart that shows the time in and time out for the employees on a daily basis. I've fetched the data from the database and all was working well. But now the columns show the data incorrectly ...

I have a chart that shows the time in and time out for the employees on a daily basis. I've fetched the data from the database and all was working well. But now the columns show the data incorrectly ...

I've got a tree like: { "nodes": [ { "id":1, "children":[ { "id":3, "children":[ {"id":4, "children":[]}, {"id":5, "children":[{"...

I've got a tree like: { "nodes": [ { "id":1, "children":[ { "id":3, "children":[ {"id":4, "children":[]}, {"id":5, "children":[{"...

Please see this minimum example https://codepen.io/rockmandash/pen/Rzwowd The code is this: <div class="cool"> <input type="checkbox" value="checkbox1"> <input type="checkbox" ...

Please see this minimum example https://codepen.io/rockmandash/pen/Rzwowd The code is this: <div class="cool"> <input type="checkbox" value="checkbox1"> <input type="checkbox" ...

  1. check event target class
  2. check event target type
  3. check event target javascript
  4. check event target is input
  5. check event target has class
  6. check event target
  7. check event target id
  8. check event target jquery
  9. check if event target is input
  10. check if event target is element
  11. check if event target has class
  12. check if event target is child
  13. javascript check event target type
  14. check if event target contains class
  15. check if event target is button
  16. react check event target
  17. check if event target is checkbox
  18. js check event target tag
  19. js check event target
  20. check if event target has id