WordPress Rest API Create Post

Your JS is sending the request directly, so abc_add_post() appears to be entirely unnecessary. The issue with your JavaScript is that this part it still within the string started with ":

xhr.setRequestHeader( 'Authentication', 'Basic ' + btoa( 'saurab:saurav123' ) );

To use a function and concatenate it you need to close the already open string:

xhr.setRequestHeader( 'Authentication', 'Basic '" + btoa( 'saurab:saurav123' ) + "');