javascript - How do I delete and move later function arguments to the left if an object type is excluded? -


i apologize if has been answered. don't know better technical term method , can't seem find here or google searches.

basically want able make function how jquery handles ajax function arguments. example: $.get(url, callback); , $.post(url, data, callback);

basically if data excluded function move callback left in place. since when function runs uses variable names input order. presuming method involve checking arguments[1] , arguments[2] want make sure if correct way since have code clean possible.

instead of checking arguments[1] , arguments[2] , should check

$.post(url, data, callback) 

whether url string, data object , callback function


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -