Complete JavaScript Keywords, Attributes, and Functions
Keywords
let / const / var
Used to declare variables.
Example: let x = 5; const y = 10;
if / else / switch
Conditional branching in code.
Example: if (x > y) {...}
for / while / do...while
Loops for iteration.
Example: for (let i = 0; i < 10; i++) {...}
break / continue
Control loop flow.
Example: if (i === 5) break;
return
Returns value from function.
Example: return x + y;
try / catch / finally
Error handling.
Example: try { ... } catch(e) { ... }
Complete JavaScript Keywords, Attributes, and Functions
throw
Throws an error manually.
Example: throw new Error('message');
function
Defines a function.
Example: function add(a, b) { return a + b; }
class / extends / super
For object-oriented programming.
Example: class Car extends Vehicle {...}
import / export
Used in modules to import/export code.
Example: export default function() {...}
await / async
Used for asynchronous code.
Example: async function() { await fetch(url); }
typeof / instanceof
Type checking.
Example: typeof x === 'string';
Complete JavaScript Keywords, Attributes, and Functions
new
Creates instance of object.
Example: let obj = new Object();
delete
Deletes object property.
Example: delete [Link];
this
Refers to current object context.
Example: [Link] = 'John';
Common Built-in Functions & Methods
alert()
Displays an alert dialog.
Example: alert('Hello');
[Link]()
Logs output to console.
Example: [Link](x);
parseInt(), parseFloat()
Converts strings to numbers.
Example: parseInt('123');
Complete JavaScript Keywords, Attributes, and Functions
setTimeout(), setInterval()
Timer functions.
Example: setTimeout(() => {}, 1000);
Array methods
forEach, map, filter, reduce etc.
Example: [Link](x => x * 2);
String methods
Includes length, toUpperCase, slice, etc.
Example: 'abc'.toUpperCase();
Object methods
[Link], values, entries, etc.
Example: [Link](obj);
JSON methods
parse, stringify.
Example: [Link]({name: 'John'});
Math object
Provides math functions like [Link](), random(), etc.
Example: [Link]([Link]() * 10);
Complete JavaScript Keywords, Attributes, and Functions
Date object
Handles date/time.
Example: new Date().toLocaleDateString();
fetch()
Makes network requests.
Example: fetch('url').then(res => [Link]());