آموزش مقدماتی جاوا اسکریپت 2024|CONSTRUCTORS | قسمت 40

تعداد بازدید : 6 | تاریخ انتشار : 12 اردیبهشت 1403 12:30 | مدت زمان : 00:05:31 | دسته بندی : فناوری و رایانه

در این دوره آموزشی قصد داریم تا شما را با اصول برنامه نویسی با زبان قدرتمندJavaScript اشنا کنیم. این مجموعه آموزشی یک مجموعه کامل برای آموزش زبان برنامه نویسی JavaScript است . // constructor = special method for defining the // properties and methods of objects function Car(make, model, year, color){ this.make = make, this.model = model, this.year = year, this.color = color, this.drive = function(){console.log(`You drive the ${this.model}`)} } const car1 = new Car("Ford", "Mustang", 2024, "red"); const car2 = new Car("Chevrolet", "Camaro", 2025, "blue"); const car3 = new Car("Dodge", "Charger", 2026, "silver"); car1.drive(); car2.drive(); car3.drive(); console.log(car1.make); console.log(car1.model); console.log(car1.year); console.log(car1.color); console.log(car2.make); console.log(car2.model); console.log(car2.year); console.log(car2.color); console.log(car3.make); console.log(car3.model); console.log(car3.year); console.log(car3.color);

javascript,جاوا اسکریپت,آموزش javascript