This is an instruction returnthat forces the containing function to return a boolean value.
- It calls a function
dihy()with the variable value yearas an argument. - It checks whether the return value is either
353or 383(the names of the properties that exist in the object literal). It doesn’t matter what the property matters; it just needs to exist inside the object. (That is, 1it's just an arbitrary value.) - If so, the function returns
true, otherwise false.
JavaScript , , , :
var foo = {353: 1, 383: 1};
function bar(year) {
return year in foo;
}
alert(bar(1955));
foo[1955] = 1;
alert(bar(1955));
MDC in.