1 / 14

JavaScript Functions | JavaScript Functions Explained |JavaScript Tutorial For Beginners|Simplilearn

This presentation on JavaScript functions covers all the basics that you need understand what are functions in JavaScript, how to create functions in JavaScript, JavaScript functions expressions, function constructor, what are self-invoking functions, functions as values, functions as object, what are array functions, generator functions and pre-defined functions. <br><br>This JavaScript Certification course helps you master the JavaScript programming language in an all-inclusive training program that includes complete JavaScript fundamentals, jQuery, Ajax, and more. You will apply your skills by building a real-time chat application.<br><br>JavaScript Course Overview:<br>This training program entails the fundamentals of JavaScript, including the enumeration and elaboration of various data types in JavaScript, an explanation of loops and conditional statements in JavaScript, and an overview of the concepts of objects and variables in JavaScript.<br><br>JavaScript Certification Key Features<br>1. 100% Money Back Guarantee<br>2. 7 complete JavaScript courses<br>3. Covers Ajax, jQuery, and node.js<br>4. Build a real-time chat application<br>5. Course completion certificate<br><br>ud83dudc49Learn more at: https://bit.ly/2SDfYlR

Simplilearn
Télécharger la présentation

JavaScript Functions | JavaScript Functions Explained |JavaScript Tutorial For Beginners|Simplilearn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What’s in it for you? What are JavaScript functions? Function expressions Function() constructor Self-invoking functions Functions as values Functions as objects Arrow functions Generator function Predefined functions

  2. What are JavaScript functions? A function is a group of reusable code which can be called anywhere in your program This eliminates the need of writing the same code again and again It helps programmers write modular codes

  3. Click here to watch the video

  4. Function Expression A JavaScript function can also be defined using an expression A function expression can be stored in a variable:

  5. The Function Constructor JavaScript functions are defined using the keyword function. Functions can also be defined using the built-in JavaScript function constructor called Function()

  6. Self-Invoking functions A self-invoking expression is invoked (started) automatically, without being called Function expressions will execute automatically if the expression is followed by () You have to add parentheses around the function to indicate that it is a function expression

  7. Functions as values In JavaScript, a function is a value, so we can deal with it as a value.  We first define the function and then assign it to a variable unlike in expressions

  8. Functions as objects JavaScript functions are a special type of objects, called function objects A function object includes a string which holds the actual code i.e., the function body of the function

  9. Arrow functions Functions can be written more compactly with the help of Arrow functions Arrow function expressions are ill suited as methods, and they cannot be used as constructors The above code can be re-written like this

  10. To create a generator, we need a special syntax construct: function*, so-called “generator function” Generator functions Regular functions return only one, single value (or nothing) Generators can return (“yield”) multiple values, one after another, on-demand To create a generator, we use the syntax: function*

  11. To create a generator, we need a special syntax construct: function*, so-called “generator function” Generator functions Regular functions return only one, single value (or nothing) Generators can return (“yield”) multiple values, one after another, on-demand To create a generator, we use the syntax: function* next() returns two properties: value: The yielded value done: True if the function code is finished, false if otherwise

  12. To create a generator, we need a special syntax construct: function*, so-called “generator function” Predefined functions eval Evaluates a string and returns a value parseInt Parses a string argument and returns an integer of the specified radix or base parseFloat Parses a string argument and returns a floating-point number escape Returns the hexadecimal encoding of an argument  unescape Returns the ASCII string for the specified value

More Related