As you can see a function is a lot like a method. If a function is defined as a property of an object it is in fact called a method of the object. It is import to keep in mind that functions in JavaScript are objects and they have the benefits of any objects, meaning they can be self contained, which provide them with a vast amount of flexibility.
The following code is a simple function that adds two numbers together
<script> function addNumbers(x, y) { return x + y; } console.log("The sum of 1 + 3 is " + addNumbers(1, 3)); </script>
The code above creates a function called addNumbers with two parameters and returns the sum of the two numbers
ReplyDeleteIt is shockingly simple to find 3 BHK pads and 2 BHK pads in Noida Extension and are accessible at reasonable rates.visit:- Ace Divino
I appreciate you sharing this blog. It's a fantastic blog, and I'm extremely impressed by how valuable it is. Are you aware? How are dice rolled on a d4? If not, learn more about it by looking at the d4 dice online blog. This blog guide you more.
ReplyDelete