Javascript Objects 1 - Combining Objects With Our Other Tools : Codecademy

preview_player
Показать описание
In this video learn how we can combine out objects with custom functions and methods! This is very valuable when it comes to OOP! Not only is this exercise easy its only 4 lessons long! So dont skip it! Like always leave a like, favorite, comment, and dont forget to subscribe!

Follow me on twitter!
Рекомендации по теме
Комментарии
Автор

thank you for your many helpful videos!

nimby
Автор

i think in exercise 4 you need to define age.e.g var age = person2.age, else you will get a reference error

utibearchibong
Автор

var olderAge = function(person1, person2) {
    if (person1.age > person2.age) {
        return person1.age;
    } else if (person2.age > person1.age) {
        return person2.age;
    } else {
        return person1.age || person2.age;
    }
};

Without making another variable.

theoiorga
Автор

i tried the set up in the video too but i still got a synax error.. so i'm at a stand still

ZianaSue
Автор

why did you need an if/else ?  can't you just have an if and an else?  

jrevburke
welcome to shbcf.ru