Latest courses
Staff picks
/* Design Pattern */
function switchFunction(num: number):string { let b: string = "functionb"; switch (num) { case 1: { let b: string = "case 1"; break; } // After break case 2: { let b: string = "case 2"; } // Before break break; }
const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY']; let arr2; (function() { arr2 = [...arr1]; // change this line arr1[0] = 'potato' })(); console.log(arr2);
class SpaceShuttle { constructor(targetPlanet){ this.targetPlanet = targetPlanet; } } var zeus = new SpaceShuttle('Jupiter'); console.log(zeus.targetPlanet) function makeClass() { class Vegetable { constructor(name){
Popular instructors
Recently published
<html> <head> <link rel="stylesheet" href="index.css"> </head> <body> <h1>index.html</h1> <script src="index.pack.js"></script> <table > <thead> <th>Id</th> <th>Title</th> <th>URL</th> </thead>
import React from 'react'; import ReactDOM from 'react-dom'; import defaultSlides from './defaultSlides'; const Slider = ({ slides }) => { // Create a curr state indicating what's the current slide's index const [curr, setCurr] = React.useState(0); const { length } = slides; const goToNext = () => { // Check if we've reached the final slide in the array // If so, go back to 0, else curr + 1 setCurr(curr === length - 1 ? 0 : curr + 1);
<!DOCTYPE html> <html lang="ko-KR"> <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>DEMO</title> </head> <body> <a href="http://www.mimibebe.kr" id="h-link04">mimibebe.kr</a> <script> // 웹 주소 객체