May The Source Be With You
var str = "A, B, C, D"; console.log(str.split(",").shift()); // output A console.log(str.split(",").pop()); // output D
Remove the set of matched elements from the DOM.
<script>&</script>
<script>&</script>