// The main paradigms supported by JavaScript include: // Imperative/Procedural Programming let x = 5; let y = 10; let sum = x + y; console.log(sum); // Example of OOP in JavaScript function Car(make, model) { this.make = make; this.model = model; } Car.prototype.start = function() { console.log("The car is starting."); }; let myCar = new Car("Toyota", "Camry"); myCar.start(); // Example of functional programming function add(x, y) { return x + y; } let result = add(3, 4); console.log(result); // Example of event-driven programming let button = document.getElementById("myButton"); button.addEventListener("click", function() { console.log("Button clicked!"); }); // Example of asynchronous programming with Promises function fetchData() { return new Promise((resolve, reject) => { setTimeout(() => { resolve("Data fetched successfully!"); }, 2000); }); } fetchData() .then(data => console.log(data)) .catch(error => console.error(error));