function my_ajax({ url = "", method = "GET", dataType = "json" } = {}) { console.log(method); } my_ajax({method: "POST"}) my_ajax();