Write Reusable JavaScript with Functions

This commit is contained in:
Abhisek Pattnaik
2015-12-26 04:17:26 +05:30
committed by SaintPeter
parent 04b1f03f1b
commit df2c747d64

View File

@ -1774,9 +1774,9 @@
"<blockquote>function functionName() {<br /> console.log(\"Hello World\");<br />}</blockquote>",
"You can call or <dfn>invoke</dfn> this function by using its name followed by parentheses, like this:",
"<code>functionName();</code>",
"Each time the function is called it will print out the message \"Hello World\" on the dev console. All of the code between the curly braces will be executed every time the function is called.",
"Each time the function is called it will print out the message <code>\"Hello World\"</code> on the dev console. All of the code between the curly braces will be executed every time the function is called.",
"<h4>Instructions</h4>",
"Create a function called <code>myFunction</code> which prints \"Hi World\" to the dev console. Call that function."
"<ol><li>Create a function called <code>myFunction</code> which prints <code>\"Hi World\"</code> to the dev console.</li><li>Call the function.</li></ol>"
],
"tests": [
"assert(typeof myFunction === 'function', 'message: <code>myFunction</code> should be a function');",