본문 바로가기

DEVELOP

(22)
TO-DO-LIST (1) 현재 html, css 까지만 진행. 동적인 리스트 구성 및 디테일한 동작들의 구현 필요. (1) 기능 목록 일정 추가 일정 체크 일정 삭제 (2) 기능 구성에 있어 고려해야할 점 할 일을 적는 입력창과, 내용 업데이트를 위해 클릭할 수 있는 버튼 할 일의 추가 또는 완전한 삭제가 이루어지면 새로운 페이지 렌더링 한 일을 체크할 경우 취소선으로 표시 위로 일정이 추가되는 방향 storage로 일정 정보에 대해 저장하며 관리 더 추가할만한 기능에 대해 생각해보고 로직을 짜보자!
[leetcode] 1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence Q. Given a sentence that consists of some words separated by a single space, and a searchWord. You have to check if searchWord is a prefix of any word in sentence. Return the index of the word in sentence where searchWord is a prefix of this word (1-indexed). If searchWord is a prefix of more than one word, return the index of the first word (minimum index). If there is no such word return -1. A..
[leetcode] 1720. Decode XORed Array Q. There is a hidden integer array arr that consists of n non-negative integers. It was encoded into another integer array encoded of length n - 1, such that encoded[i] = arr[i] XOR arr[i + 1]. For example, if arr = [1,0,2,1], then encoded = [1,2,3]. You are given the encoded array. You are also given an integer first, that is the first element of arr, i.e. arr[0]. Return the original array arr...
[leetcode] 1431. Kids With the Greatest Number of Candies Q. Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the ith kid has. For each kid check if there is a way to distribute extraCandies among the kids such that he or she can have the greatest number of candies among them. Notice that multiple kids can have the greatest number of candies. let kidsWithCandies = function(candies, extraCandie..
[JavaScript] 객체 객체 자바스크립트는 객체 기반의 언어이다. 사실상 원시 타입의 값들을 제외한 함수와 배열 등 대부분의 값들이 모두 객체에 해당한다고 볼 수 있으며, 따라서 다른 개념들을 좀 더 정확하게 이해하기 위해서라도 객체에 대한 이해는 필수적이라 할수 있다. 1. 객체의 개념 객체는 원시 타입의 값들과 달리 변경 가능한 값이며, 프로퍼티로 구성된다. 객체의 프로퍼티 값이 함수인 경우는 메소드로 부른다. 프로퍼티는 객체의 '상태'를 나타내고, 메소드는 프로퍼티를 참조하고 조작할 수 있는 역할을 한다. 객체는 값과 동작을 하나의 단위로 구조화 할 수 있기 때문에 유용하다. 2. 객체 생성 let apple = { type: 'fruit', color: 'red', weight: '300' }; 일반적으로 자바스크립트에..
[JavaScript] 배열의 메소드 배열은 리스트와 비슷한 객체이며, 탐색 및 변형을 가능하게 하는 다양한 메소드를 가진다. 다음 내용은 배열을 다룰 때 자주 사용되는 메소드들에 대해 간단하게 정리한 것이다. 1. 배열 끝에 항목 추가: array.push() mutable let arr = ['a','b','c']; arr.push('d'); // ['a','b','c','d'] push는 하나 혹은 그 이상의 요소를 배열의 끝에 추가해주는 메소드로, 배열의 새로운 길이를 리턴한다. 2. 배열 끝에서부터 항목 제거: array.pop() mutable let arr = ['apple', 'banana', 'melon']; fruit.pop(); // ['apple', 'banana'] pop은 배열에서 마지막 요소를 제거하고, 해당 요소..