JS - Add query string to parameter if value exist in JSON

0 votes
188 views
added Jul 6, 2018 in Javascript by LC Marshal Captain (25,790 points)
edited Jul 12, 2018 by LC Marshal
let status = null; 
      
if(this.actionType === 'buy') {
  status = 1;
  let status1 = window.location.search + `&status=${status}`;
  console.log(status1);
  // window.location.href = status1;
} else if(this.actionType === 'fund') {
  status = 2;
  let status2 = window.location.search + `&status=${status}`;
  console.log(status2);
  // window.location.href = status2;
}
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...