title: How can I simplify this two lines of JavaScript so that it's not repetitive?
body: <p>I managed to fix an issue by writing these two lines of code:</p>
  <pre><code>MyString = div.getAttribute('data-type') || div.getAttribute('data-id');
  MyString = MyString.replace('RemoveThis', '');
  </code></pre>
  <p>Although it's working fine, but it seems that I'm repeating MyString to often.
  I tried to make it shorter as follow:</p>
  <pre><code>MyString = div.getAttribute('data-type') || div.getAttribute('data-id').replace('RemoveThis', '');
  </code></pre>
  <p>But it didn't work.</p>
  <p>Any hints how can I avoid repeating MyString?</p>
  <p>Would the above solution pass a code review?</p>