I am trying to use the || operator to use create simple statement to filter out certain values of e.origin here is my if statement:
window.addEventListener('message', function (e) {
if(e.origin !== 'http://localhost:3000' && e.origin !== "https://dev.site.com" && e.origin !== "https://prod.site.com" && e.origin !== "https://stage.site.com") return;
$('#dataDiv').data('data', e.data.test);
});
basically what i am trying to do is filter all my origins for security reasons. is this the best way to do this. any suggestions will be helpful.