실제로 어떻게 쓰이나요?
아래 예문들을 통해 각 단어가 어떤 상황에서 어떻게 쓰일 수 있는지 감을 잡아보세요!
unshift
예문
You can use the unshift method to add a new element to the beginning of the array. [unshift: verb]
unshift 메서드를 사용하여 배열의 시작 부분에 새 요소를 추가할 수 있습니다. [unshift: 동사]
예문
The unshift operation is used to insert an element at the beginning of the queue. [unshift: noun]
unshift 작업은 큐의 시작 부분에 요소를 삽입하는 데 사용됩니다. [unshift: 명사]
prepend
예문
You can use the prepend function to add a new character to the beginning of the string. [prepend: verb]
prepend 함수를 사용하여 문자열의 시작 부분에 새 문자를 추가할 수 있습니다. [앞에 추가: 동사]
예문
The prepend operation is used to insert an element at the beginning of the sequence. [prepend: noun]
앞에 추가 작업은 시퀀스의 시작 부분에 요소를 삽입하는 데 사용됩니다. [앞에 추가: 명사]
추가로 알아두면 좋아요
어떤 단어가 더 많이 쓰이나요?
Unshift는 프로그래밍 언어에서 prepend보다 더 일반적으로 사용되며, 특히 배열로 작업할 때 사용됩니다. 그러나 prepend는 문자열의 시작 부분에 문자를 추가하거나 연결된 목록의 맨 앞에 요소를 추가하는 데 여전히 유용한 방법입니다.
어떤 단어가 더 포멀한가요?
unshift와 prepend는 모두 프로그래밍에 사용되는 기술 용어이므로 일반적으로 공식 언어로 간주됩니다.