검색 결과

CSSOM 명세서 스타일시트와 스타일 규칙, 이 둘을 어떻게 조작할 수 있는지, 이 둘과 문서 사이의 관계를 어떻게 조작할 수 있는지에 대한 설명이 담겨있고, https://www.w3… 몇몇 클래스에 대한 설명은 https://spec.whatwg.org/에서 확인할 수 있습니다.… 프로퍼티나 메서드에 대한 설명을 읽고 싶을 때 Mozilla 재단의 매뉴얼 https://developer.mozilla.org/en-US/search을 찾아보는 것도 좋긴 하지만,… 검색창에 ‘WHATWG [용어]’ 혹은 'MDN [용어]'로 검색하면 명세서나 MDN문서에서 원하는 내용을 쉽게 찾을 수 있습니다. https://google.com?… q=whatwg+localstorage, https://google.com?q=mdn+localstorage 처럼 말이죠.
공식 버전이 나오기 이전의 최신 초안은 https://tc39.es/ecma262/에서 확인할 수 있습니다.… 갓 명세서에 등록된 기능이나 '등록되기 바로 직전’에 있는 기능(스테이지(stage)3 상태의 기능), 제안 목록은 https://github.com/tc39/proposals에서… 링크는 다음과 같습니다. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference 위 사이트에 들어가서 원하는 내용을 직접… Google 검색 엔진에 접속해 'MDN [원하는 용어]'를 입력해 봅시다. parseInt 함수에 대한 정보를 얻고 싶다면 https://google.com/search?… http://caniuse.com 에선 브라우저가 특정 기능을 지원하는지 (표 형태로) 확인할 수 있습니다.
Built-in events mostly have composed: true, as described in the relevant specifications: UI Events https… ://www.w3.org/TR/uievents.… Touch Events https://w3c.github.io/touch-events.… Pointer Events https://www.w3.org/TR/pointerevents. …And so on.
v, \f, \r 을 포함하는 공백 기호 \w ('word(단어)'의 ‘w’) ‘단어에 들어가는’ 문자로 라틴 문자나 숫자, 밑줄 _을 포함합니다.… 키릴 문자나 힌디 문자같은 비 라틴 문자는 \w에 포함되지 않습니다.… 예를 들어 \d\s\w는 1 a처럼 ‘숫자’ 뒤에 ‘공백 문자’ 뒤에 '단어에 들어가는 문자’를 의미합니다. 정규 표현식에 일반 기호와 문자 클래스를 같이 사용할 수 있습니다.… Firefox, IE, Edge에서 지원하지 않음 https://caniuse.com/#search=dotall에서 지원 여부의 최신 상황을 확인해보세요.… \d – 숫자 \D – 숫자가 아닌 문자 \s – 스페이스, 탭, 줄 바꿈 문자 \S – \s를 제외한 모든 문자 \w – 라틴 문자, 숫자, 밑줄 '_' \W – \w를 제외한 모든
예시: Uint8Array – ArrayBuffer의 각 바이트를 별개의 숫자로 취급합니다. 1바이트는 8비트이므로 0부터 255까지의 값을 가질 수 있으며 이러한 값을 '8비트… Float64Array – 8바이트마다 하나의 부동 소수점 숫자로 취급합니다. 5.0x10-324부터 1.8x10308까지의 값을 가질 수 있습니다.… 예를 들어 Int8Array, Uint8Array 등이 있으며 전체 목록은 곧 살펴보겠습니다. new TypedArray와 같은 표현을 본다면 new Int8Array, new Uint8Array와… Uint8Array에 256을 넣는다고 생각해 봅시다. 256의 이진 형태는 100000000 (9비트)이지만 Uint8Array는 값 하나당 8비트만 제공하기 때문에 0부터 255까지의… 이 점에서 Uint8ClampedArray는 특별하게 동작합니다. Uint8ClampedArray는 255보다 큰 숫자는 255로, 음수는 0으로 저장합니다.
문자 유니코드 유니코드의 바이트 수 a 0x0061 2 ≈ 0x2248 2 𝒳 0x1d4b3 4 𝒴 0x1d4b4 4 😄 0x1f604 4 보다시피… Hex_digit은 16진수 숫자인 0-9, a-f를 포함합니다. 이것 말고도 더 있죠. 유니코드는 정말 다양한 프로퍼티를 지원합니다.… 문자별 프로퍼티 목록: https://unicode.org/cldr/utility/character.jsp 프로퍼티별 문자 목록: https://unicode.org/cldr/utility… /list-unicodeset.jsp 프로퍼티별 줄임말: https://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt… 텍스트 형식으로 정리된 유니코드 문자와 각 문자의 모든 프로퍼티: https://www.unicode.org/Public/UCD/latest/ucd/ 예시: 16진수.실제 사례로
then they wouldn’t want a script from john-smith.com to read our mail from gmail.com.… These URLs all share the same origin: http://site.com http://site.com/ http://site.com/my/page.html… These ones do not: http://www.site.com (another domain: www. matters) http://site.org (another domain… : .org matters) https://site.com (another protocol: https) http://site.com:8080 (another port: 8080)… But if windows share the same second-level domain, for instance john.site.com, peter.site.com and site.com
보안 규칙 덕분에 해커가 만든 웹 사이트 hacker.com에서 gmail.com에 있는 메일 박스에 접근할 수 없던 것이죠.… 다음으로 src="http://another.com/weather.json?… CORS와 안전한 요청.크로스 오리진 요청을 보낼 경우 브라우저는 항상 Origin이라는 헤더를 요청에 추가합니다. https://javascript.info/page에서 https… ://anywhere.com/request에 요청을 보낸다고 가정해 봅시다.… 따라서 fetch('http://another.com')를 사용해 요청을 보내도 another.com 관련 쿠키가 함께 전송되지 않습니다. 왜 그럴까요?
In regular expressions that’s (\w+\.)… , because the hyphen does not belong to class \w.… We can fix it by replacing \w with [\w-] in every word except the last one: ([\w-]+\.)+\w+.… \w]+.… A polyfill may be required, such as https://github.com/ljharb/String.prototype.matchAll.
secure. secure 이 옵션을 설정하면 HTTPS로 통신하는 경우에만 쿠키가 전송됩니다. secure 옵션이 없으면 기본 설정이 적용되어 http://site.com에서 설정… (생성)한 쿠키를 https://site.com에서 읽을 수 있고, https://site.com에서 설정(생성)한 쿠키도 http://site.com에서 읽을 수 있습니다.… 하지만 secure 옵션이 설정된 경우, https://site.com에서 설정한 쿠키는 http://site.com에서 접근할 수 없습니다.… 이 사이트엔 해커에게 송금을 요청하는 폼(form) <form action="https://bank.com/pay">이 있고, 이 폼은 자동으로 제출되도록… 배너는 다른 도메인 <img src="https://ads.com/banner.png"> 에서 가져옵니다.
Request from HTTPS to HTTP (from safe to unsafe protocol).… instead of http://site.com/path.… "strict-origin" – send only origin, don’t send Referer for HTTPS→HTTP requests.… "unsafe-url" – always send full url in Referer, even for HTTPS→HTTP requests.… Referer: https://javascript.info/admin/secret/paths.
줄 번호 8도 클릭해 중단점을 하나 더 추가해봅시다. 지금까지 잘 따라오셨다면 아래와 같은 화면이 보여야 합니다.… 줄 번호 4와 8이 파란색으로 바뀐 게 보이시죠?… -- https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/Images/src/largeIcons.svg… --> – ‘Resume’: 스크립트 실행을 다시 시작함 (단축키 F8) 실행을 재개합니다.… Google에서 제공하는 개발자 도구 공식 매뉴얼은 https://developers.google.com/web/tools/chrome-devtools에서 확인할 수 있습니다.
For instance, [a-z] is a character in range from a to z, and [0-5] is a digit from 0 to 5.… If we’d like to look for lowercase letters as well, we can add the range a-f: [0-9A-Fa-f].… For instance, if we’d like to look for a wordly character \w or a hyphen -, then the set is [\w-].… 9], \w – is the same as [a-zA-Z0-9_], \s – is the same as [\t\n\v\f\r ], plus few other rare unicode… Example: multi-language \w.As the character class \w is a shorthand for [a-zA-Z0-9_], it can’t find Chinese
be also user and password properties if HTTP authentication is present: http://login:password@site.com… …”.Let’s say we want to create a url with given search params, for instance, https://google.com/search… are not allowed, must be encoded, for instance non-latin letters and spaces – replaced with their UTF-8… The URL became longer, because each cyrillic letter is represented with two bytes in UTF-8, so there
Over that link the evil page positions a transparent <iframe> with src from facebook.com, in such… Here’s the same example, but closer to reality, with opacity:0 for <iframe>: 결과facebook.htmlindex.htmlAll… Technically, if we have a text field to hack, then we can position an iframe in such a way that text… This not a reliable defence, because there are many ways to hack around it. Let’s cover a few.
We’ll use a regexp ^(\w+\s?)*$, it specifies 0 or more such words.… Now the star * goes after \w+\s instead of \w+\s?.… , \w+\s, \w+\w+ and so on.… With the rewritten pattern (\w+\s)*, that’s impossible: there may be \w+\s or \w+\s\w+\s, but not \w… +\w+.
다른 베지어 곡선 cubic-bezier(0.0, 0.5, 0.5 ,1.0)을 사용해서 말이죠.… ease* ease-in ease-out ease-in-out (0.25, 0.1, 0.25, 1.0) (0.42, 0, 1.0, 1.0) (0, 0, 0.58, 1.0) (… 0.42, 0, 0.58, 1.0)… 베지어 곡선 cubic-bezier(0.0, 0.5, 0.5 ,1.0)을 사용한 것처럼 기차가 점점 느려지긴 하지만 프로세스 정도가 조금 다른 것을 확인할 수 있습니다.… 초별로 프로세스가 몇 %씩 진행되는지를 정리하면 다음과 같죠. 0s – -10% (애니메이션이 시작하자마자 바로 첫 번째 단계가 수행됨) 1s – -20% … 8s – -80% (
Means “zero or one”, the same as {0,1}. In other words, it makes the symbol optional.… [a-z][a-z0-9]*>/i We added an optional slash /? near the beginning of the pattern.… For instance, for HTML tags we could use a simpler regexp: <\w+>.… But as HTML has stricter restrictions for a tag name, <[a-z][a-z0-9]*> is more reliable.… Can we use <\w+> or we need <[a-z][a-z0-9]*>?
new Date(milliseconds) UTC 기준(UTC+0) 1970년 1월 1일 000초에서 milliseconds 밀리초(1/1000 초) 후의 시점이 저장된 Date… 값이 없는 경우엔 1일로 처리됩니다. hours/minutes/seconds/ms에 값이 없는 경우엔 0으로 처리됩니다.… getDay() 일요일을 나타내는 0부터 토요일을 나타내는 6까지의 숫자 중 하나를 반환합니다.… 아래 두 메서드는 위에서 소개한 메서드와 달리 표준시(UTC+0) 기준의 날짜 구성 요소를 반환해주는 메서드가 없습니다.… 월은 0부터 시작합니다(0은 1월을 나타냅니다). 요일은 getDay()를 사용하면 얻을 수 있는데, 요일 역시 0부터 시작합니다(0은 일요일을 나타냅니다).
byteStart – the starting byte, by default 0.… encoding represents binary data as a string of ultra-safe “readable” characters with ASCII-codes from 0… For screenshotting a page, we can use a library such as https… ://github.com/niklasvh/html2canvas.… FileReader: Summary.While ArrayBuffer, Uint8Array
https://caniuse.com/#feat=bigint에서 브라우저별 지원 여부를 확인할 수 있습니다.… 논리 연산.bigint는 if 안이나 다른 논리 연산자와 함께 사용할 때 일반 숫자와 동일하게 행동합니다. if안에서 0n은 falsy이고 다른 값들은 truthy로 평가되죠.
We’ll look for variable name using regexp \w+.… A call to str.match(/\w+/) will find only the first word in the line. Or all words with the flag g.… When a regexp is created, its lastIndex is 0.… We performed a search of \w+… As we can see, regexp /\w+
The native interface to IndexedDB, described in the specification https://www.w3.org/TR/IndexedDB, is… We can also use async/await with the help of a promise-based wrapper, like https://github.com/jakearchibald… , but right now in 2.0 there isn’t.… Let’s use a thin promise wrapper https://github.com/jakearchibald/idb further in this chapter.… The examples are at the lib page https://github.com/jakearchibald/idb.
that qualify as word boundaries: At string start, if the first string character is a word character \w.… Between two characters in the string, where one is a word character \w and the other is not.… At string end, if the last string character is a word character \w.… \b (because the exclamation sign is not a wordly character \w, so there’s no word boundary after it).… on the one side from the position and “not \w” – on the other side.
0.2의 합이 0.3과 일치하는지 확인 했는데 false가 출력되었습니다.… 두 종류의 0 자바스크립트 내부에서 숫자를 표현하는 방식 때문에 발생하는 또 다른 흥미로운 현상은 0과 -0이라는 두 종류의 0이 존재한다는 사실입니다.… NaN을 대상으로 비교할 때: Object.is(NaN, NaN) === true임. 0과 -0이 다르게 취급되어야 할 때: Object.is(0, -0) === false임.… 숫자를 나타내는 비트가 모두 0이더라도 부호를 나타내는 비트는 다르므로 0과 -0은 사실 다른 값이긴 합니다.… 자바스크립트는 특별한 변환 없이 16진수(0x), 8진수(0o), 2진수(0b)를 바로 사용할 수 있게 지원합니다. parseInt(str, base)를 사용하면 str을 base진수로
. -1을 입력하면 에러가 발생하고, 연산 시간은 0ms가 됩니다. 두 경우 모두 연산 시간이 정상적으로 측정되었네요.… window.onerror만으로 스크립트를 복구하는 건 사실상 불가능하죠. window.onerror는 개발자에게 에러 메시지를 보내는 용도로 사용합니다. window.onerror말고 https… ://errorception.com 나 http://www.muscula.com같은 에러 로깅 관련 상용 서비스가 여러 가지 있습니다.
V8 – Chrome과 Opera에서 쓰입니다. SpiderMonkey – Firefox에서 쓰입니다.… "X라는 기능은 V8에서만 지원합니다."라는 식으로 말이죠.… 다시 한번 강조하지만, 이런 제약사항은 사용자의 보안을 위해 만들어졌습니다. http://anysite.com에서 받아온 페이지가 http://gmail.com에서 받아온 페이지 상의
ws말고 wss://라는 프로토콜도 있는데, 두 프로토콜의 관계는 HTTP와 HTTPS의 관계와 유사합니다.… Origin – 클라이언트 오리진(예시에선 https://javascript.info)을 나타냅니다.… 커넥션 상태.커넥션 상태를 알고 싶다면 socket.readyState 프로퍼티의 값을 확인하면 됩니다. 0 – “CONNECTING”: 연결 중 1 – “OPEN”: 연결이 성립되고… Requests to WebSocket use wss://ws.site.com, a subdomain that leads to the WebSocket server, while https… ://site.com goes to the main HTTP-server.
So, e.g. a script at https://facebook.com can’t read the user’s mailbox at https://gmail.com.
label – 기본적인 인코딩 방식은 utf-8이지만 big5, windows-1251 및 다른 인코딩 방식도 지원됩니다. options – 선택 항목입니다.… TextEncoder는 인코딩 시 'utf-8’만 지원합니다. 2가지 메서드가 있습니다.… encode(str) – Uint8Array에 문자열을 반환합니다. encodeInto(str, destination) – Uint8Array 구조 형태로 문자열 str를 destination에
HTML Living Standard: https://html.spec.whatwg.org/#custom-elements.… Compatiblity: https://caniuse.com/#feat=custom-elements.… Edge is a bit behind, but there’s a polyfill https://github.com/webcomponents/polyfills/tree/master/packages
클라이언트는 https://api.github.com/repos/<repo>/commits 형태의 URL로 요청을 보냅니다.… 헤더에서 https://api.github.com/repositories/93253246/commits?page=2형태의 URL만 추출하기 위해 정규표현식을 사용하였습니다.
DOM: https://dom.spec.whatwg.org/#shadow-trees Compatibility: https://caniuse.com/#feat=shadowdomv1 Shadow
URLSearchParams – 데이터를 x-www-form-urlencoded 형태로 보내기 위해 쓰이는데, 요즘엔 잘 사용하지 않습니다.… POST 요청을 보낼 때 주의할 점은 요청 본문이 문자열일 때 Content-Type 헤더가 text/plain;charset=UTF-8로 기본 설정된다는 점입니다.
저수준(low-level) 프로그래밍에 익숙하다면, A tour of V8: Garbage Collection을 읽어보세요.… V8 가비지 컬렉터에 대한 자세한 내용을 확인해 볼 수 있습니다. V8 공식 블로그에도 메모리 관리 방법 변화에 대한 내용이 올라옵니다.… 가비지 컬렉션을 심도 있게 학습하려면 V8 내부구조를 공부하거나 V8 엔지니어로 일했던 Vyacheslav Egorov의 블로그를 읽는 것도 좋습니다.… 여러 엔진 중 ‘V8’ 엔진을 언급하는 이유는 인터넷에서 관련 글을 쉽게 찾을 수 있기 때문입니다.… V8과 타 엔진들은 동작 방법이 비슷한데, 가비지 컬렉션 동작 방식에는 많은 차이가 있습니다. 저수준 최적화가 필요한 상황이라면, 엔진에 대한 조예가 깊어야 합니다.
이제 가장 마지막에 선택했던 요소는 $0으로, 그 이전에 선택했던 요소는 $1로 접근할 수 있습니다.… 예를 들어 콘솔 창에 $0.style.background = 'red'을 입력하면 아래와 같이 첫 번째 list 아이템이 붉은색으로 표시되는 걸 볼 수 있습니다.… Chrome 개발자 도구 문서 사이트 https://developers.google.com/web/tools/chrome-devtools로 가시면 다양한 기능을 살펴볼 수 있습니다.
properties: done – true when the reading is complete, otherwise false. value – a typed array of bytes: Uint8Array… At the end, we have chunks – an array of Uint8Array byte chunks.… single method that concatenates those, so there’s some code to do that: We create chunksAll = new Uint8Array
그렇지만 이미지가 로드되는 것은 기다리지 않기 때문에 alert 창엔 이미지 사이즈가 0이라고 뜹니다.… 메서드에 대한 자세한 설명은 https://w3c.github.io/beacon/에서 찾아볼 수 있습니다. sendBeacon는 데이터를 백그라운드에서 전송합니다.
(단, n은 자연수이고, 조건 n≥0을 만족해야 합니다.) 사실 자바스크립트엔 거듭제곱 연산자 **가 있습니다.… 예시에선 pow(2, 3)의 결괏값과 8을 비교하겠죠. 비교나 확인에 쓰이는 다른 함수들은 아래에서 다시 소개해 드리겠습니다. 명세서는 실행 가능합니다.… 지금 상황에선 pow(2,3)가 8이 아닌 undefined를 반환하기 때문에 에러가 발생합니다.… : 두 번째 테스트가 실패했네요. assert에선 함수 리턴값이 81이 될 것이라 기대하고 있었는데, 함수는 항상 8을… 카운터 변수를 0으로 만들거나 테스트가 바뀔 때(또는 테스트 그룹이 바뀔 때)마다 해줘야 하는 작업이 있으면 이들을 이용할 수 있습니다.
V8 엔진에선 이를 '마이크로태스크 큐(microtask queue)'라고 부르기 때문에 이 용어가 좀 더 선호됩니다. 명세서의 설명을 살펴봅시다.… 요약.모든 프라미스 동작은 ‘마이크로태스크 큐’(ES8 용어)라 불리는 내부 ‘프라미스 잡(promise job)’ 큐에 들어가서 처리되기 때문에 프라미스 핸들링은 항상 비동기로 처리됩니다
Here we have only one file, so we just take input.files[0].… ArrayBuffer. readAsText(blob, [encoding]) – read the data as a text string with the given encoding (utf-8
새로운 제안(proposal)이 정기적으로 등록, 분석되고, 가치가 있다고 판단되는 제안은 https://tc39.github.io/ecma262/에 추가됩니다.… 엔진별로 어떤 기능을 지원하고 있는지는 https://kangax.github.io/compat-table/es6/에서 확인할 수 있습니다.
이렇게 태스크가 추가되는 큐는 V8 용어로 '매크로태스크 큐(macrotask queue)'라고 부릅니다.… 앞부분 100줄만 먼저 강조하고, 지연시간이 0인 setTimeout을 사용해 새롭게 스케줄링을 한 다음, 그 다음 100줄을 강조하는 식으로 코드를 변경하면 되죠.… 이럴 때 연기시킬 액션 관련 코드를 지연 시간이 0인 setTimeout으로 감싸면 원하는 동작을 구현할 수 있습니다.… 지연시간이 0인 setTimeout(f) 사용하기 이 방법을 사용하면 계산이 복잡한 큰 태스크 하나를 여러 개로 쪼갤 수 있습니다.… 지연시간이 0인 setTimeout은 이벤트가 완전히 처리되고 난 후(버블링이 끝난 후)에 특정 작업을 수행하도록 스케줄링할 때도 사용됩니다.
[[Environment]]엔 {count: 0}이 있는 렉시컬 환경에 대한 참조가 저장됩니다.… 디버깅 시, 최적화 과정에서 제거된 변수를 사용할 수 없다는 점은 V8 엔진(Chrome, Edge, Opera에서 쓰임)의 주요 부작용입니다.… 이런 V8만의 부작용을 미리 알아 놓는 것이 좋습니다. Chrome이나 Edge, Opera에서 디버깅하는 경우라면 언젠간 이 이슈를 만나게 될 테니까요.… 이 부작용은 버그라기보다는 V8만의 특별한 기능이라고 생각하시면 될 것 같습니다. 미래에 이 기능은 변경될 수 있습니다.
In the regular expression language that can be written as [0-5]\d: the first digit 0-5, and then any… If we glue minutes and seconds together, we get the pattern: [01]\d|2[0-3]:[0-5]\d.… The alternation | now happens to be between [01]\d and 2[0-3]:[0-5]\d.… 3]:[0-5]\d.… Let’s correct that by enclosing “hours” into parentheses: ([01]\d|2[0-3]):[0-5]\d.
데모에선 't’가 '0.05’씩 증가해 `0, 0.05, 0.1, 0.15, … 0.95, 1’이 되도록 하였습니다. t값을 사용해 다음과 같은 추가 작업을 할 수 있습니다.… 예를 들어 설명하면 다음과 같습니다. t가 0일 땐 두 점이 선분의 시작인 조절점 1과 2에 위치합니다. t가 0.25일 땐 조절점 1에서 조절점 1과 2를 이은 선분의 길이에 25%… t=0.25 t=0.5 이제 파란색 선분에서 t 값과 비례하는 위치에 점 하나를 찍습니다. t가 0.25일 때(왼쪽 그림)는 파란 선분의 4분의 1지점에 빨간점을… 조절점이 (0,0), (0.5, 1), (1, 0)인 경우, 방정식은 다음과 같습니다.… x = (1−t)2 * 0 + 2(1−t)t * 0.5 + t2 * 1 = (1-t)t + t2 = t y = (1−t)2 * 0 + 2(1−t)t * 1 + t2 * 0 = 2(1
전달받은 값 형 변환 후 undefined NaN null 0 true and false 1 과 0 string 문자열의 처음과 끝 공백이 제거됩니다.… PHP 등의 일부 언어에선 문자열 "0"을 false로 취급합니다.… 전달받은 값 형 변환 후 undefined NaN null 0 true / false 1 / 0 string 전달받은 문자열을 “그대로” 읽되, 처음과 끝의 공백을… 숫자형으로 변환 시 undefined는 0이 아니라 NaN이 됩니다.… 문자열 "0"과 " "같은 공백은 불린형으로 변환 시 true가 됩니다.
객체 프로퍼티를 프로퍼티 키와 다른 이름을 가진 변수에 저장해봅시다. options.width를 w라는 변수에 저장하는 식으로 말이죠.… 위 예시에선 프로퍼티 width를 변수 w에, 프로퍼티 height를 변수 h에 저장했습니다. 프로퍼티 title은 동일한 이름을 가진 변수 title에 저장됩니다.
<select> 요소에 대한 명세는 아래 링크에서 볼 수 있습니다 https://html.spec.whatwg.org/multipage/forms.html#the-select-element… 명세서: https://html.spec.whatwg.org/multipage/forms.html.
동등 비교 연산자 ==는 (예시에서 문자열 "0"을 숫자 0으로 변환시킨 것처럼) 피연산자를 숫자형으로 바꾸지만, 'Boolean’을 사용한 명시적 변환에는 다른… 빈 문자열과 false는 숫자형으로 변환하면 0이 되죠. 그렇다면 0과 false는 어떻게 구별할 수 있을까요?… 이후, 어떻게 하면 에지 케이스가 만들어내는 함정에 빠지지 않을 수 있을지에 대해 알아보겠습니다. null vs 0.null과 0을 비교해 봅시다.… 거짓을, (3)에서 null >= 0이 참을 반환하는 이유는 (기타 비교 연산자의 동작 원리에 따라) null이 숫자형으로 변환돼 0이 되기 때문입니다.… 위 예시를 보면 undefined는 0을 매우 싫어하는 것처럼 보입니다. 항상 false를 반환하고 있네요. 이런 결과는 아래와 같은 이유 때문에 발생합니다.
50 개의 검색 결과만 보기