Functions in JS
Duration: 3 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Reasoning Ability: Inequality, Syllogisms, Coding Decoding, Blood Relations, Directions (Direction Test), Ranking, Order and Sequence, Series (Number and Letter Series) (Numerical Relations and Reasoning), Seating Arrangements, Puzzle Solving (Puzzles), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Data Sufficiency, Data Arrangement, Machine Input-Output
- Computer Aptitude: Logic Gates & Hardware, Number System, Number Representation, Basics of COA, Introduction to OS, Windows OS, Linux OS, Security, Virtual Memory, Introduction to CN, Hardware basics, Network Security, Basics of DBMS, Website, Browser & Services, Internet Fundamentals, Server Side & Security, Emerging Technologies, MS Office Applications
- Data Analysis & Interpretation: Data Interpretation
- General Awareness / Banking Awareness: Evolution of Indian Banking (Banking & Financial Awareness)
- English Language: Noun, Pronoun, Adjectives, Articles, Verb, Tenses, Subject Verb Agreement (Verb Noun Agreement), Adverb, Preposition, Conjunction, Modals, Vocabulary, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Correction (Error Correction), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Completion (Fill in the blanks), Verbal Analogy (Word Based Analogy), English Writing Ability
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.

