// If the color is red, turn it green if (color.is_red()) { color.turn_green(); }
/* The API currently returns an array of items even though that will change in an upcoming ticket. Therefore, be sure to change the loop style here so that we properly iterate over an object */ var api_result = {items: ["one", "two"]}, items = api_result.items, num_items = items.length; for(var x = 0; x < num_items; x++) { ... }
function Person(name) { this.name = name; this.first_name = name.split(" ")[0]; // This is just a shot in the dark here. If we can extract the first name, let's do it }
if (person.age < 21) { person.can_drink = false; // 21 drinking age /* Fees are given to those under 25, but only in some states. */ person.has_car_rental_fee = function(state) { if (state === "MI") { return true; } }; }
if (person.age >= 21) { person.can_drink = true; // A person can drink at 21 person.can_smoke = true; // A person can smoke at 18 person.can_wed = true; // A person can get married at 18 person.can_see_all_movies = true; // A person can see all movies at 17 //I hate babies and children and all things pure because I comment too much }
Copyright 2014-2023 //m.sbmmt.com/ All Rights Reserved | 苏州跃动光标网络科技有限公司 | 苏ICP备2020058653号-1
| 本站CDN由 数掘科技 提供