function showWarning(options) { var width = options.width || 200; // по умолчанию var height = options.height || 100; var contents = options.contents || "Предупреждение"; } showWarning({ contents: "Вы вызвали функцию" // и всё понятно! }); How to check that the argument that is passed to the function is an object?