Functions in JS
Duration: 3 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- About the course: About the Course
- General Knowledge: Polity, Physics, Biology, State Wise GK, Chemistry, History, Geography, GK- Current Affairs, Indian Economy, Static General Knowledge, Environment, Evolution of Indian Banking (Banking & Financial Awareness)
- Mental Aptitude and Reasoning: Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Permutation and Combination, Number System, Sequence and Series (Series), Speed Time and Distance, Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Vocabulary, Profit and Loss, Arithmetic, Mental Ability, Percentage, Algebra, Mensuration and Geometry, Age Problems, Clock, Calendar, Verbal Analogy (Word Based Analogy), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Analogy, Analytical Reasoning (Counting Figures Reasoning), Puzzle Solving (Puzzles), Selection Decision Table (Decision Making), Cubes & Dices, Blood Relations, Venn Diagram, Logical Sequence Of Words, Inequality, Directions (Direction Test), Data Arrangement, Facts, Inference and Judgements, Syllogisms, Seating Arrangements, Ranking, Order and Sequence
- CS | Computer Fundamentals: Basics of COA, Number System, Number Representation, C Fundamentals, Algorithm Analysis, Input Output Organisation
- CS | Database Management System: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, SQL
- CS | Workplace productivity Tools: MS Office Applications, Keyboard Shortcuts
- CS | Computer Networks: Introduction to CN, Data Communication, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Transport Layer Services, Application Layer, Hardware Basics, Network Security
- CS | The Internet: Website, Browser & Services, Internet Fundamentals, Web Design & Development, Web Publishing & Hosting, Server Side & Security, Emerging Technologies
- CS | Emerging Technologies: Artificial Intelligence, Emerging Tech Trends, Introduction to OS, Windows OS, Linux OS, Unix OS, JavaScript-Basics
- CS | Boolean algebra: Digital Systems & Boolean Basics, Boolean Expression, Boolean Minimization, Logic Gates & Hardware
- CS | Data Structures: Introduction to DS, Array, Stack, Queue
- CS | Cryptography: Society, Law & Ethics, Cyber Threats and Malware Attacks, Role of Internet and Web Services, Security in Mobile and Wireless Computing, Electronic Data Interchange and E-Commerce, Physical Security and Cryptography Basics, Intrusion Detection Systems (IDS), Cyber Safety and Security
- UP Police Previous Year Papers:
- UP Police Full Mock Tests:
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
The video lecture provides a detailed introduction to creating functions in JavaScript. The instructor utilizes a PDF document titled "Creating Functions" which outlines the fundamental syntax rules. The text explains that a function is defined using the `function` keyword, followed by a unique name and parentheses. It specifies that function names can include letters, digits, underscores, and dollar signs, adhering to the same rules as variables. The parentheses may contain parameter names separated by commas, and the code to be executed is placed inside curly brackets.
Chapters
0:00 – 2:00 00:00-02:00
The session begins with the instructor displaying a PDF slide titled "Creating Functions". The visible text details the syntax: "A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses ()." The instructor starts writing on the digital whiteboard, first scribbling some numbers like "0.03", "0x", "468", and "123 -> decimal" at the top. Then, they begin writing the word "function" and start a new example labeled "Sum(". The screen text further explains that the code to be executed is placed inside curly brackets, showing a template: `function name(parameter1, parameter2, parameter3) { // code to be executed }`.
2:00 – 2:47 02:00-02:47
The instructor continues to flesh out the code examples. They write a function named `welcome` with empty parentheses: `function welcome() { document.write("Welcome"); }`. This demonstrates a function with no parameters. Next, they write a more complex example: `function Sum(a, b, c) { let s = a+b+c; }`. This shows how to define parameters `a`, `b`, and `c` inside the parentheses and use them within the function body to calculate a sum. The instructor underlines the function call `welcome()` at the bottom, indicating how the function is invoked.
The lecture effectively bridges the gap between theoretical documentation and practical coding. It starts by establishing the rigid syntax rules found in the PDF, such as the requirement for the `function` keyword and the use of curly brackets. The instructor then transitions to a hands-on demonstration, writing out a simple text-output function and a mathematical summation function. By explicitly writing the parameters `a`, `b`, and `c` and the calculation `let s = a+b+c`, the instructor clarifies how data is passed into a function and processed effectively.