Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
β Coding devil/7: Generics
πDescription
extends
ν€μλλ₯Ό μ¬μ©ν΄μ νμ₯ν μ μλ€.<T extends number | string>
μ μ λ€λ¦ Tκ° numberλ string νμ μ΄μ΄μΌ νλ€λ μλ―Έμ΄λ€.πSummary
μ λ€λ¦ ν¨μ:
T
)λ₯Ό μ¬μ©νλ©°, νΈμΆν λ νμ μ μ§μ ν μ μλ€.μ λ€λ¦ μΈν°νμ΄μ€:
option
κ³Ό κ°μ μμ±μ μ λ€λ¦μΌλ‘ μ€μ νμ¬ λμ€μ νΉμ νμ μΌλ‘ κ²°μ λ μ μλ€.μ λ€λ¦ νμ₯:
extends
ν€μλλ₯Ό μ¬μ©ν΄ μ λ€λ¦μ νΉμ 쑰건μ λΆμ¬ν μ μμΌλ©°, μ΄λ₯Ό ν΅ν΄ νμ μ μ ννκ³ νμ₯λ κΈ°λ₯μ μ 곡ν μ μλ€.