Skip to content

Instantly share code, notes, and snippets.

View jung-han's full-sized avatar
🏠
Working from home

hanjung jung-han

🏠
Working from home
View GitHub Profile
@jung-han
jung-han / lodashTemplate.html
Created February 22, 2018 12:38
lodash template
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>LODASH</title>
</head>
<body>
<div id="appendPoint"></div>
# -*- coding: utf-8 -*-
import sys
import datetime
import time
import calendar
import operator
from prettytable import PrettyTable
def isMonitorRequest(requestList):
if "/monitor/l7check" in requestList:
// node v8.10.0
var a = 2;
function aFunc(v1){
var a = 1;
this.a = 3;
return v1 + 1;
}
aFunc(1);
console.log(a); // 2
function Person(){}
Person.prototype.name = "hanjung";
Person.prototype.age = 27;
Person.prototype.getName = function(){
return this.name;
}
var inst1 = new Person();
console.log(inst1.name);
Person.prototype = {
@jung-han
jung-han / today.js
Last active April 13, 2018 05:41
오늘의 자바스크립트 문제
/* 문제 1 */
var boolVal = new Boolean(false);
var a = boolVal && true;
console.log(a); // ?
var boolVal = false;
var a = boolVal && true;
console.log(a); // ?
getNodesHavingClassName: function(nodes, className) {
var i,
tagIndex,
resultNodes = [],
classList = [];
for (i = 0; i < nodes.length; i += 1) {
classList = nodes[i].className;
classList = classList.length === 0 ? [] : classList.split(' ');
if (!Array.prototype.indexOf) {
tagIndex = arrayutil.indexOf(classList, className);
'use strict';
var arrayutil = require('./arrayutil');
var domutil = {
getElementsByClassName: function(element, selector) {
if (!selector) {
throw new Error('Uncaught TypeError: Failed to execute "getElementsByClassName": 1 argument required, but only 0 present.');
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>tooltip testpage</title>
</head>
<body>
<p>The standard Lorem Ipsum passage, used since the 1500s</p>
var layoutCode =
'<div id="container">'
+ '<div id="input-div">'
+ '<input id="job-input" type="text">'
+ '<button id="submit-btn">생성</button>'
+ '</div>'
+ '<ul id="todo-list-ul"></ul>'
+ '<div id="tooltip-info-div" class="tooltip-info-div">'
+ '<div class="info-div">'
+ '<span id="left-job-cnt">0</span><span> left items</span>'

chapter4 확장된 객체 기능

객체 카테고리

ES6에서는 다음과 같이 객체들의 카테고리를 명확하게 나눈다.

  1. 일반 객체(ordinary objects): 자바스크립트 객체의 모든 기본 내부 동작을 가진다.
  2. 이형 객체(exotic objects): 기본과 다른 내부동작을 지닌다.
  3. 표준 객체(standard objects): ES6에서 정의 되었으며 Array, Date등이 포함된다. 일반 객체이거나 이형객체일 수 있다.
  4. 내장 객체(built-in objects): 자바스크립트 실행환경에 따라 존재하는 객체이다. 모든 표준객체는 내장객체이다.

객체 리터럴의 문법 확장