반응형

분류 전체보기 1480

What is the most efficient way to deep clone an object in JavaScript?

This question's answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions. What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but that's non-standard and only supported by Firefox. I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency..

How to check whether a string contains a substring in JavaScript?

This question's answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions. Usually I would expect a String.contains() method, but there doesn't seem to be one. What is a reasonable way to check for this? ECMAScript 6 introduced String.prototype.includes: const string = "foo"; const substring = "oo"; console.log(string.in..

JavaScript에서 현재 연도 가져오기

질문자 :Satch3000 JavaScript에서 현재 연도를 어떻게 얻습니까? new Date() 객체를 만들고 getFullYear() 호출합니다. new Date().getFullYear() // returns the current year 항상 현재 연도를 표시하는 바닥글과 같은 몇 가지 기본 예제 컨텍스트를 제공하기 위해 허용된 답변을 가로채기: © 위의 HTML이 로드된 후 실행되는 다른 위치: document.getElementById("year").innerHTML = new Date().getFullYear(); footer { text-align: center; font-family: sans-serif; } © 2018 by FooBar Jason Harwig // Return tod..

etc./StackOverFlow 2023.05.04

로컬 Git 브랜치를 원격 브랜치와 비교하는 방법

질문자 :mrblah 로컬 브랜치와 원격 브랜치 diff 은 어떻게 볼 수 있습니까? git diff / 예를 들어, git diff main origin/main 또는 git diff featureA origin/next 물론 말했다 원격 추적 브랜치 중 당신은 할 필요가 git fetch 첫째; 원격 저장소의 분기에 대한 최신 정보가 필요합니다. Jakub Narębski 원격 추적 분기를 업데이트하려면 git fetch 를 입력한 다음 다음을 입력해야 합니다. git diff git branch -a 모든 분기(로컬 및 원격)를 나열한 다음 목록에서 분기 이름을 선택할 수 있습니다(원격 분기 이름에서 remotes/ 예: git diff main origin/main (여기서 "main"은 로컬 메..

etc./StackOverFlow 2023.05.04

"린팅"이란 무엇입니까?

질문자 :Ashkan Kh. Nazary PHPLint , JSLint , 그리고 저는 최근 에 일부 IDE 에 대한 내용을 읽는 동안 "즉석에서 JS 코드를 린트할 수 있습니다"를 발견했습니다. 그래서, 무엇을 "linting"는 무엇입니까? Linting은 잠재적인 오류에 대해 코드를 분석하는 프로그램을 실행하는 프로세스입니다. Wikipedia에서 Lint 를 참조하십시오. lint는 원래 C 언어 소스 코드에서 일부 의심스럽고 이식 불가능한 구조(버그일 가능성이 있음)에 플래그를 지정하는 특정 프로그램에 부여된 이름입니다. 이 용어는 이제 모든 컴퓨터 언어로 작성된 소프트웨어에서 의심스러운 사용을 표시하는 도구에 일반적으로 적용됩니다. Oded Lint는 C 코드를 통해 컴파일, 링크 및 실행하기..

etc./StackOverFlow 2023.05.04
반응형