[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/in [Back]  [Original]

in - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

in

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

in true .

In this article

js
 in ;

.

.

in .

js
// 
var trees = new Array("redwood", "bay", "cedar", "oak", "maple");
0 in trees; // true .
3 in trees; // true .
6 in trees; // false .
"bay" in trees; // false .    ,    .
"length" in trees; // true . length Array()  .

//   
"PI" in Math; // true .
"P" + "I" in Math; // true .

//   
var myCar = {
  company: "Lamborghini",
  model: "Lamborghini Veneno Roadster",
  year: 2014,
};
"company" in myCar; // true .
"model" in myCar; // true .

in . String .

js
var color1 = new String("green");
"length" in color1; // true .

var color2 = "coral";
"length" in color2; // color2 String    .

in

in delete false .

js
var myCar = {
  company: "Lamborghini",
  model: "Lamborghini Veneno Roadster",
  year: 2014,
};
delete myCar.company;
"company" in myCar; // false .

var trees = new Array("redwood", "bay", "cedar", "oak", "maple");
delete trees[3];
3 in trees; // false .

undefined , in true .

js
var myCar = {
  company: "Lamborghini",
  model: "Lamborghini Veneno Roadster",
  year: 2014,
};
myCar.company = undefined;
"company" in myCar; // true .
js
var trees = new Array("redwood", "bay", "cedar", "oak", "maple");
trees[3] = undefined;
3 in trees; // true .

in true .

js
"toString" in {}; // true .

Specification
ECMAScript 2027 LanguageSpecification
# sec-relational-operators


Web Proxy Viewer  |  New URL  |  Original Page