IfBreakpoint.js

Try it out!
Open up the console and resize your browser window.

Breakpoint

1. Add the ifbreakpoint.js after jQuery

Bootstrap 4

Bootstrap 3

2. Then use it in your custom scripts

$(document).ready(function(){
  // update onload
  $("h2").text( breakpoint ); 
  
  if ( xs == true ) { 
    alert("mobile first");
  }

  // Update on window resize
  $( window ).resize( function(){
    $("h2").text( breakpoint ); 
  }); 

});

It also adds and updates a body class on window resize. Resize your window and use chrome web inspector to see the change.