Применение функций

// определение функции var sayHi = function (who) { return “Hello” + (who ? “, “ + who : “”) + “!”; }; // вызов функции sayHi(); // “Hello!” sayHi(‘world’); // “Hello, world!” // применение функции sayHi.apply(null, [“hello”]); // “Hello, hello!”

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.