Javascript match method

https://stackoverflow.com/questions/49216567/javascript-match-method

task: Your image should have a src attribute that points to this placeholder image: http://via.placeholder.com/350x150.

see the below image . my function should check the img src attribute have the same url or not. how to do that in javscript

<img id="myImage" src="http://via.placeholder.com/350x150"/>
<div id="isMatch"></div>
<script>
function checkImg(checkThisImg) {
 return checkThisImg === myImage.src ? "Matches" : "Does Not Match";
}
isMatch.innerText = checkImg("http://via.placeholder.com/350x150");
</script>