title: Getting the value from key in a dictionary that is nearest to a given number using JavaScript
body: <p>I have a dictionary (keys are integers, values are float). I would now ask the dictionary for the value of the key that is > than the given number but &lt; than the next greater key. </p>
  
  <p>Example:</p>
  
  <p>dict = {100: 0.0035, 150: 0.0024, 200: 0.0019}.</p>
  
  <p>i give 122, it should give me 0.0035</p>
  
  <p>i give 333, it should give me 0.0019</p>
  
  <p>i give 200, it should give me 0.0024</p>
  
  <p>Thanks!</p>