YagomCareerStarterCamp-6 / Interview-study-in-swift

1 stars 0 forks source link

[5주차] Q2_Subscripts에 대해 설명하시오. #14

Open seohyeon2 opened 1 year ago

seohyeon2 commented 1 year ago

꼬리질문

kiwi1023 commented 1 year ago

클래스, 구조체 그리고 열거형에서 스크립트를 정의해 사용할 수 있다. 서브스크립트란 콜렉션, 리스트, 시퀀스 등 집합의 특정 멤버 요소에 간단하게 접근할 수 있는 문법이다. 서브스크립트를 이용하면 추가적인 메소드 없이 특정 값을 할당(assign)하거나 가져올 수(retrieve) 있다.

Judy-999 commented 1 year ago

컬렉션, 리스트, 시퀀스 등 집합의 특정 element에 간단하게 접근할 수 있는 문법으로 []로 표시합니다.

Groot-94 commented 1 year ago

클래스나 구조체 등 타입에서 데이터에 []로 접근할 수 있도록 선언한다.

seohyeon2 commented 1 year ago

답변