LC·Dict

const

C1abbreviation
US/kɑːnst/UK/kɒnst/드물게 쓰임

프로그래밍에서 쓰는 technical abbreviation으로, ‘constant’ 또는 상수 선언을 뜻함

noun명사

  1. 1

    const 키워드, 상수 선언프로그래밍에서 상수나 재할당할 수 없는 선언을 나타내는 키워드 또는 약어C1programming

    a programming keyword or abbreviation used to declare or mark something as constant or not reassignable

    • In JavaScript, const creates a variable that cannot be reassigned.

      JavaScript에서 const는 재할당할 수 없는 변수를 만듭니다.

    • Use const for values that should stay the same.

      같게 유지되어야 하는 값에는 const를 사용하세요.

    유의어constant

    반의어variable

adjective형용사

  1. 1

    const 선언된, 수정 불가의프로그래밍에서 const로 선언된; 수정되거나 재할당되지 않도록 표시된C1programming

    declared with const; marked in code as not to be modified or reassigned

    • The function receives a const reference to avoid copying the object.

      그 함수는 객체 복사를 피하려고 const 참조를 받습니다.

    • The compiler gives an error if you change const data.

      const 데이터를 변경하면 컴파일러가 오류를 냅니다.

    유의어read-only, immutable

    반의어mutable

뉘앙스 · 쓰임

‘constant’는 완전한 일반 단어이고, ‘const’는 코드에서 쓰는 짧은 형태입니다. JavaScript의 ‘const’는 재할당을 막는 선언이고, C/C++의 ‘const’는 값이나 객체를 수정하지 않겠다는 타입 한정자에 가깝습니다.

프로그래밍 언어마다 의미가 조금 다릅니다. 예를 들어 JavaScript에서 const로 선언한 변수는 재할당할 수 없지만, 객체 내부 속성까지 항상 불변이라는 뜻은 아닙니다. 일반 글에서는 처음에 ‘constant’라고 풀어 쓰고, 코드나 개발자 대화에서는 ‘const’를 그대로 쓰는 경우가 많습니다.

유의어 뉘앙스 비교

constant
‘constant’는 완전한 단어이고, ‘const’는 코드에서 쓰는 약어입니다.
read-only
‘read-only’는 읽기만 가능하다는 뜻을 더 직접적으로 나타내며, ‘const’는 특정 언어의 키워드입니다.
immutable
‘immutable’은 객체나 값 자체가 바뀔 수 없다는 더 넓은 개념이고, ‘const’의 실제 효과는 언어마다 다릅니다.

반의어

variable
‘variable’은 값이 바뀔 수 있는 항목을 가리키며, ‘const’와 반대되는 개념으로 쓰일 수 있습니다.
mutable
‘mutable’은 변경 가능하다는 뜻으로, const로 보호되는 상태와 반대입니다.

자주 쓰는 표현 · Collocations

noun+noun

  • const keywordconst 키워드
  • const declarationconst 선언

adj+noun

  • const variableconst 변수
  • const pointerconst 포인터
  • const referenceconst 참조

verb+prep+noun

  • declare with constconst로 선언하다

어원 · 암기 팁

[English]‘const’는 영어 ‘constant’를 줄인 프로그래밍 약어입니다. ‘constant’는 라틴어 ‘constans’에서 온 말로, ‘굳게 서 있는, 변하지 않는’이라는 뜻과 관련됩니다.

constant의 앞부분을 줄인 약어

💡 const = constant의 줄임말이라고 기억하면 됩니다. 코드에서 ‘변하지 않게 고정한다’는 뜻으로 연결해 외우기 쉽습니다.