목록Javascript (3)
Web Dev Log
let str = "hello world. new world.";let arr = str.split(" "); // 공백으로 구분해서 배열 저장 for(let i = 0; i let tmp = arr[i]; console.log(i + " => " + tmp);}# 결과0 => hello1 => world.2 => new3 => world.
1. 문자를 아스키 또는 유니코드 번호로 변환 var e = 'A';var h = '가'; console.log( e.charCodeAt(0) );// 출력결과 65// ascii 코드로 나옴 console.log( h.charCodeat(0) );// 출력결과 44032// 한글은 유니코드 번호로 나옴// 십진수 44032를 16진수로 AC00 2. 아스키코드 또는 유니코드를 문자로 변환 var e2 = String.fromCharCode(65);var h2 = String.fromCharCode(44032); console.log( e2 );// 출력결과 A console.log( h2 );// 출력결과 가
// 1.프로그램 설치 // 2. 환경설정 // 3. 변수 선언 var a = 1; // 전연변수 let b= 2; // 지역변수 const c = 3 // 상수 // 4. 타입지정 형지정 var aa : number = 1; var bb : string = 'aa'; var cc : boolean = true; // 5. 튜플 let aaa : [number, string ]; // 6. enum 열거형 enum days { Sunday, monday, thusday }; console.log( days.Sunday ); enum days2 {sunday = 1, monday = 2 }; console.log( days.Sunday ); console.log( days[1] ); // 7. any 형 ..