본문 바로가기

전체 글171

[ 번역 ] this in JavaScript and TypeScript 보호되어 있는 글 입니다. 2023. 10. 31.
맥 숨김폴더/파일 보는 방법 shift + cmd + . 참조 https://thisiswhyimyoung.com/%EB%A7%A5-%EC%88%A8%EA%B9%80%ED%8C%8C%EC%9D%BC/ 2023. 10. 30.
[ 번역 ] Symbol in JavaScript and TypeScript 보호되어 있는 글 입니다. 2023. 10. 30.
[ 번역 ] Boolean in JavaScript and TypeScript You will learn: - Union types - null & undefined as types - Value types (or literal types) boolean은 자바스크립트에서 재밌는 원시 데이터 타입입니다. 타입스크립트에서, boolean은 총 4 가지의 값을 가능하게 합니다. 잠깐만, 4개 라구요? Boolean in JavaScript boolean은 true 와 false의 값을 가질 수 있습니다. 다른 타입으로부터의 값은 truthy 이거나 falsy 일 수 있습니다, undefined 또는 null 같이요. falsy로 판단되는 값들 중에 undefined,null,false 말고도 ""(빈 문자열), -0, 0, NaN 이 있습니다. 어떤 값에서 불린 값을 가져오려면, Bo.. 2023. 10. 29.
[ 빈도수 세기 패턴 / 정답 ] sameFrequency 문제 sameFrequency라는 함수를 작성하세요. 두 개의 양의 정수가 주어졌을 때, 두 숫자의 자릿수가 같은 빈도를 갖는지 구합니다. 여러분의 솔루션은 반드시 다음과 같은 복잡성을 가져야 합니다.: Time: O(N) 예시) sameFrequency(182,281) // true sameFrequency(34,14) // false sameFrequency(3589578, 5879385) // true sameFrequency(22,222) // false 내 풀이 - 정답 function sameFrequency(num1,num2){ //make number to array const arr1 = [...String(num1)] //['1','8','2'] const arr2 = [...Strin.. 2023. 10. 29.
[ 빈도수 세기 패턴 / 오답 ] validAnagram 문제 Given two strings, write a function to determine if the second string is an anagram of the first. An anagram is a word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman. (no spaces, all lowercase words) validAnagram('','') //true validAnagram('aaz','zza') //false validAnagram('anagram','nagaram') /.. 2023. 10. 29.