반응형

development/javascript 3

자바스크립트에서 enum 사용하는 방법

javascript에서 enum을 구현하는 방법들 C#이나 Java와 같은 다른 언어와 달리 자바스크립트는 열거형에 대한 기본 지원을 제공하지 않는다.자바스크립트에서 enum을 구현하는 방법은 여러 가지가 있다. 각 구현에는 고유한 장단점이 있다.  Javascript에는 enum이라는 예약된 키워드가 있지만 현재는 언어에서 어떤 용도로도 사용되지 않는다. 향후 사용을 위해 예약되어 있을 뿐이다.  enum을 객체 키로 정의해서 구현하기enum의 기본 구현을 위해 enum 유형을 캡슐화하는 객체를 정의하고 각 열거형 값에 대한 키를 할당할 수 있다.예를 들어, 각 계절을 키로 하고 대표 문자열을 값으로 하는 객체로 계절을 표현할 수 있다.  숫자를 값으로 사용하여 이를 수행할 수도 있다.   이 방법은 ..

동시성, 병렬성, 그리고 자바스크립트에 대한 이해

동시성, 병렬성, 그리고 자바스크립트에 대한 이해 원문 : https://www.rugu.dev/en/blog/concurrency-and-parallelism/ Understanding Concurrency, Parallelism and JS | ruguUnderstanding Concurrency, Parallelism and JS Written at 2024-09-08 - Updated at 2024-09-18 Up until now, I was not aware that concurrency and parallelism were actually different things since they are often used interchangeably by some. I just learned tha..

구글이 색인 과정에서 자바스크립트를 처리하는 방법

구글이 색인 과정에서 자바스크립트를 처리하는 방법 원문: https://vercel.com/blog/how-google-handles-javascript-throughout-the-indexing-process How Google handles JavaScript throughout the indexing process - VercelOver the years, Google's treatment of JavaScript has changed, leaving us with misconceptions of how it's indexed. Here, we debunk the myths.vercel.com  MERJ와 버셀의 실증적 연구를 통해 구글의 렌더링 과정을 밝혀보겠습니다. 검색 엔진이 웹 페이지를 크롤..

반응형