TIL Nov. 3rd week

hyeonze·2021년 11월 15일
0

TIL

목록 보기
22/22

JS30 3강

CSS 사용자 지정 변수

css :root, --
css전역변수

HTMLElement.dataset

<input type="range" data-sizing="px" data-name="wes">

console.log(this.dataset); // {sizing: "px" name: "wes"}
console.log(this.dataset.sizing); // px

$var.style.setProperty("background-color", "red");

새 CSS속성 설정하는 매서드

JS30 4강

객체의 키값을 기준으로 정렬하기

const ordered = inventors.sort(function(a, b) {
	if(a.year > b.year) {
    		return (1);
    	} else {
    		return (-1);
    	}
});

console.log 대신 console.table로 배열이나 객체 이쁘게 보기

reduce매서드로 객체의 값 누적하기

reduce매서드 사용

알고리즘 1-9강

replace 함수와 정규식

function solution(s){//문자열에서 모든 A 치환
    let answer=s;
    answer=answer.replace(/A/g, "#");//정규식 사용
    return answer;
}

참고자료

profile
Advanced thinking should be put into advanced code.

0개의 댓글

관련 채용 정보