Functions & Parameters — Free JavaScript Tutorial
Learn Functions & Parameters in JavaScript with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Functions & Parameters in JavaScript with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Functions & Parameters in JavaScript
Function declaration: `function name(params) { ... }` — hoisted, can be called before definition.
Function expression: `const name = function(params) { ... }` — not hoisted.
Arrow function: `const name = (params) => expression` — concise, no own `this`.
Default parameters: `function greet(name="Student")` — used if argument is undefined.
Rest parameters: `function sum(...nums)` — collects all arguments into an array.
Learn Functions & Parameters step by step with Syllab's free interactive JavaScript tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full JavaScript course →