title: How to use string replace in a jquery for loop?
body: <p>I am trying to strip out the domain from the url - but not sure exactly how.  This is what I'm attempting but as you can see console.log doesnt show anything on the second try.</p>
  
  <pre><code>function show_records(data) {
    let html = "";
    $.each(data, function(k, v){
      console.log(v.url)  // returns full urls eg. https://google.com
      v.url = v.url.replace(/https?:\/\/[^\/]+/i, "");
      console.log(v.url)  // returns nothing
      html += `&lt;input type="radio" name="${v.url}" /&gt; ${ v.url }&lt;br /&gt;`
    })
    html+='&lt;/div&gt;&lt;/div&gt;'
    $('.editviewm').append(html);
  
  }    
  </code></pre>
  
  <p>What am I doing wrong here?</p>