Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getFormulaUrl(formula){
  2.   const baseUrl = "https://www.ad.nl/abonnementen/ad"
  3.   const dictionary = {
  4.     "fiets": "ketting",
  5.     "tand": "wiel",
  6.   }
  7.   let formulaValue;
  8.  
  9.  
  10.   for(var item in dictionary) {
  11.     debugger
  12.     if(formula == item) {
  13.       formulaValue = dictionary[item]
  14.     }
  15.   }
  16.  
  17.   if (!!formulaValue) {
  18.     return `${baseUrl}/snel-bestellen/?abo_type=${formulaValue}`;
  19.   }
  20.  
  21.   return baseUrl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement