Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                // 다음 링크를 참고하세요. https://eastflag.co.kr/frontend/javascript/lodash/

var books = [
  {title: "Three Little Pigs", price: 20, author: "Jacobs", rank: 1},
  {title: "Alice in Wonderland", price: 25, author: "Carroll", rank: 2},
  {title: "Seven Dwarfs", price: 35, author: "Disney", rank: 3},
  {title: "Swallow's gift", price: 15, author: "Unknown", rank: 4},
];

let result;

// 1. Find the object whose title is  Alice in Wonderland.


// 2. Create a new array with rank < 3


// 3. Sum all the price of books array.


// 4. Print the title of the most expensive book.


// 5. After sorting the title first, create a new array with a rank number before a title
// the result is
// [ '1. Alice in Wonderland',
//   '2. Seven Dwarfs',
//   '3. Swallow\'s gift',
//   '4. Three Little Pigs' ]



// 6. date가 중복인 데이터를 제외하고 시간순서대로 소팅하시오.
const dataList = [
  {date: "09-01 12:02", value: 3},
  {date: "09-01 12:01", value: 2},
  {date: "09-01 12:00", value: 1},
  {date: "09-01 12:00", value: 1},
  {date: "09-01 12:00", value: 2},
  {date: "09-01 12:00", value: 3},
  {date: "09-01 12:01", value: 1}
];

// 일차원 배열을 x를 기준으로 이차원 배열로 만드시오.
const gridList = [
  {x: 1, y: 1},
  {x: 1, y: 2},
  {x: 2, y: 1},
  {x: 2, y: 2}
]
// [
//   [
//     {x: 1, y: 1},
//     {x: 1, y: 2},
//   ],
//     [
//     {x: 2, y: 1},
//     {x: 2, y: 2},
//   ]
// ]

// 7. 아래 이차원 배열을 일차원 배열로 변환하시오.
const gridList2 = [
  [
    {x: 1, y: 1},
    {x: 1, y: 2},
  ],
    [
    {x: 2, y: 1},
    {x: 2, y: 2},
  ]
]

// 8. 모든 태그들을 구해서 소팅을 하고 중복을 제거한 string array를 구하시오.
const frontList = [{
  title: 'angular',
  tags: ['js', 'google', 'framework']
}, {
  title: 'react',
  tags: ['js', 'facebook', 'library']
}, {
  title: 'vue',
  tags: ['js', 'library']
}];

// 9. 1부터 1000까지 중에서 2 또는 3의 배수인 숫자의 합을 구하시오.


// 10. resize시 'some logic' 를 출력하는 로직이 아래와 같이 존재한다.
//     아래 이벤트를 설정후 창 크기를 리사이징하게 되면 'some logic' 이 너무 많이 출력된다.
//     리사이즈가 끝난후 1초후에 한번만 출력되도록 하라.
window.onresize = function() {
  console.log('some logic');
}


              
            
!
999px

Console