BASE STACK JAVASCRIPT

BotTrade Books

BASE STACK JAVASCRIPT

The basics a person must keep hold of while AI writes the code, in one JavaScript volume: 365 words to keep in mind, 17 code boxes that have been run, and in every chapter questions to answer, lines t

BASE STACK JAVASCRIPT · 444pp.

Google Play

맛보기 — 눌러서 들어 보세요A taste — tap to hear it

A taste of the first two chapters. Every chapter is in the book.

  1. 자바스크립트jabaseukeuripteu

    JavaScript자바스크립트

    웹 쪽에서 돌도록 만들어졌고 이제는 서버에서도 쓰는 프로그래밍 언어The programming language made for web pages and now used on servers too

    자바스크립트는 브라우저와 서버 둘 다에서 돈다.JavaScript runs both in the browser and on a server.

  2. ECMAScript (표준 이름)ECMAScript

    ECMAScript엑마스크립트

    자바스크립트 언어 자체를 적어 둔 표준의 이름The name of the standard that writes down the language itself

    언어의 규칙은 ECMAScript 표준에 적혀 있다.The rules of the language are written in the ECMAScript standard.

  3. 엔진enjin

    engine엔전

    적어 둔 코드를 읽어 실제로 돌리는 프로그램The program that reads the written code and actually runs it

    같은 코드를 엔진마다 똑같이 돌려야 한다.Every engine has to run the same code the same way.

  4. 런타임 (돌아가는 자리)reontaim

    runtime런타임

    엔진에 더해 시간·파일·화면 같은 바깥 기능까지 갖춘 돌아가는 자리The engine plus the outside abilities around it, such as timers, files, or a screen

    파일을 읽는 일은 언어가 아니라 런타임이 준다.Reading a file comes from the runtime, not from the language.

  5. 브라우저beuraujeo

    browser브라우저

    웹 쪽을 보여 주고 그 안에서 자바스크립트를 돌리는 프로그램The program that shows web pages and runs JavaScript inside them

    브라우저는 쪽을 그리고 스크립트를 돌린다.A browser draws the page and runs the script.

  6. 콘솔konsol

    console칸솔

    돌아가는 동안 글을 찍어 보고 바로 쳐 볼 수 있는 창The window where output is printed and lines can be typed straight in

    콘솔에 찍어 보고 값이 맞는지 본다.Print to the console and see whether the value is right.

  7. 스크립트seukeuripteu

    script스크립트

    한 덩어리로 읽히는 코드 한 벌One batch of code that is read as a single piece

    스크립트 한 벌이 위에서 아래로 읽힌다.One script is read from top to bottom.

  8. 소스 코드 (원본 코드)soseu kodeu

    source code소스 코우드

    사람이 읽고 쓰는 글꼴의 코드The code in the form a person reads and writes

    소스 코드는 사람이 읽을 수 있어야 한다.Source code has to be readable by a person.

  9. 문 (statement)mun

    statement스테잇먼트

    한 가지 일을 시키는 코드 한 마디One step of code that tells the machine to do a thing

    문 하나가 한 가지 일을 한다.One statement does one thing.

  10. 식 (expression)sik

    expression익스프레션

    값 하나로 셈해지는 코드 조각A piece of code that works out to a single value

    식은 값이 되고, 문은 일을 한다.An expression becomes a value; a statement does work.

  11. 세미콜론semikollon

    semicolon세미코울런

    문이 여기서 끝났음을 알리는 쌍점 하나The mark that says a statement ends here

    한 줄에 문 두 개를 쓸 때는 세미콜론으로 가른다.Separate two statements on one line with a semicolon.

  12. 선언seoneon

    declaration데클러레이션

    이름을 처음 만들어 두는 일Creating a name for the first time

    선언은 한 범위에서 한 번만 한다.Declare a name once in a scope.

  13. 주석juseok

    comment카멘트

    돌아가지 않고 사람에게만 보이는 글Text that does not run and is there only for people

    주석에는 왜 그렇게 했는지를 적는다.Write why it was done that way in the comment.

  14. 엄격 모드eomgyeok modeu

    strict mode스트릭트 모우드

    느슨한 옛 규칙을 끄고 실수를 바로 에러로 알리는 모드A mode that turns off loose old rules and reports mistakes as errors

    모듈 안의 코드는 늘 엄격 모드로 돈다.Code inside a module always runs in strict mode.

  15. 문법munbeop

    syntax신택스

    코드를 어떤 모양으로 적어야 하는지의 규칙The rules for the shape the code must be written in

    문법이 틀리면 돌기 전에 막힌다.Broken syntax stops it before it runs.

  16. 표준pyojun

    standard스탠더드

    여러 엔진이 같게 움직이도록 함께 정해 적어 둔 것What was agreed and written down so every engine behaves the same

    표준에 적힌 대로면 어느 브라우저에서나 같다.If it is in the standard, it is the same in every browser.

  17. 인터프리터 (해석기)inteopeuriteo

    interpreter인터프러터

    코드를 미리 다 번역하지 않고 읽어 가며 돌리는 방식Running code while reading it, instead of translating it all first

    인터프리터는 읽으면서 바로 돌린다.An interpreter runs the code as it reads it.

  18. 에러 메시지ereo mesiji

    error message에러 메서지

    무엇이 어디서 어긋났는지 기계가 돌려주는 글The line the machine gives back saying what went wrong and where

    에러 메시지를 끝까지 읽는 것이 먼저다.Reading the error message to the end comes first.

  19. 부수 효과busu hyogwa

    side effect사이드 이풱트

    값을 돌려주는 일 말고 바깥을 바꿔 놓는 일Changing something outside, beyond giving a value back

    찍기와 저장은 부수 효과다.Printing and saving are side effects.

  20. 명세myeongse

    specification스페시퓌케이션

    무엇을 만들지 말로 정확히 적어 둔 것What to build, written down exactly in words

    명세를 적고 나서 코드를 맡긴다.Write the specification, then hand over the code.

  21. 값gap

    value봴류

    코드가 다루는 하나하나의 내용A single piece of what the code works on

    값은 숫자일 수도 글일 수도 있다.A value can be a number or a piece of text.

  22. 타입 (형)taip

    type타이프

    그 값이 어떤 종류이고 무엇을 할 수 있는지What kind a value is and what can be done with it

    타입을 모르면 결과를 못 믿는다.Without knowing the type you cannot trust the result.

  23. 원시 값wonsi gap

    primitive value프리머티븨 봴류

    더 쪼개지지 않고 바꿀 수도 없는 값A value that cannot be broken down or changed

    숫자와 글자는 원시 값이다.Numbers and text are primitive values.

  24. 숫자sutja

    number넘버

    정수와 소수를 한 타입으로 다루는 수The one type that holds both whole numbers and decimals

    자바스크립트는 정수와 소수를 한 숫자 타입으로 다룬다.JavaScript holds whole numbers and decimals in one number type.

  25. 문자열munjayeol

    string스트링

    글자를 늘어놓은 값A value made of characters in a row

    문자열은 따옴표로 감싼다.A string is wrapped in quotes.

  26. 불리언 (논리값)bullieon

    boolean불리언

    참과 거짓 둘만 가지는 값A value that is only true or false

    조건의 답은 불리언이다.The answer to a condition is a boolean.

  27. undefined (값 없음)undefined

    undefined언디퐈인드

    자리는 있는데 아직 아무 값도 넣지 않았을 때의 값The value when a slot exists but nothing has been put in yet

    없는 속성을 읽으면 undefined 가 나온다.Reading a missing property gives undefined.

  28. null (빈 값)null

    null널

    사람이 일부러 「없다」고 넣어 둔 값The value a person puts in on purpose to mean 'nothing'

    값을 비웠다고 알릴 때 null 을 넣는다.Put null in to say the value was emptied on purpose.

  29. 심볼simbol

    symbol심블

    다른 어떤 것과도 겹치지 않는 이름표로 쓰는 값A value used as a label that collides with nothing else

    심볼을 키로 쓰면 다른 코드와 겹치지 않는다.A symbol key never collides with other code.

  30. BigInt (큰 정수)BigInt

    BigInt빅인트

    숫자 타입이 못 담을 만큼 큰 정수를 담는 타입The type for whole numbers too big for the number type

    아주 큰 정수는 BigInt 로 담는다.Hold very large whole numbers as BigInt.

  31. 객체gaekche

    object아브젝트

    이름 붙은 값을 여러 개 묶어 둔 것Several named values held together

    객체는 이름과 값의 짝으로 이루어진다.An object is made of name and value pairs.

  32. typeof (타입 묻기)typeof

    typeof타입오브

    값이 어떤 타입인지 글로 돌려주는 연산자The operator that gives back a value's type as text

    typeof 로 타입을 먼저 확인한다.Check the type first with typeof.

  33. 타입 변환taip byeonhwan

    type conversion타이프 컨붜전

    값을 다른 타입의 값으로 바꾸는 일Turning a value into a value of another type

    글자를 숫자로 바꿀 때는 밝혀 적는다.When text becomes a number, say so on purpose.

  34. NaN (숫자가 아님)NaN

    NaN낸

    셈을 했지만 숫자가 나오지 않았을 때의 숫자 값The number value for a calculation that did not come out as a number

    숫자가 아닌 글을 셈하면 NaN 이 된다.Calculating with non-numeric text gives NaN.

  35. Infinity (무한)Infinity

    Infinity인퓌니티

    담을 수 있는 수보다 커졌을 때의 값The value for something larger than can be held

    일을 영으로 나누면 Infinity 가 된다.One divided by zero gives Infinity.

  36. 부동소수점budongsosujeom

    floating-point픨로우팅-포인트

    소수를 두 조각(가수와 지수)으로 담는 방식 — 그래서 조금 어긋난다Holding decimals in two parts, which is why they drift a little

    부동소수점이라 영점일 더하기 영점이는 영점삼이 아니다.Because of floating-point, 0.1 plus 0.2 is not 0.3.

  37. 정수jeongsu

    integer인터저

    소수점이 없는 수A number with no decimal point

    번호와 개수는 정수로 센다.Count numbers and amounts as integers.

  38. 템플릿 리터럴tempeullit riteoreol

    template literal템플럿 을리터럴

    역따옴표로 감싸 값을 글 속에 끼워 넣는 문자열A string in backticks that drops values into the text

    템플릿 리터럴로 이름을 글 속에 끼운다.Drop the name into the text with a template literal.

  39. 길이giri

    length을렝쓰

    문자열의 글자 수 — 글자가 아니라 코드 단위로 센다How many units a string has, counted in code units rather than letters

    이모지는 길이가 이로 센다.An emoji counts as a length of 2.

  40. 불변bulbyeon

    immutable이뮤터블

    한번 만들어지면 그 값 자체는 바뀌지 않음Once made, the value itself never changes

    원시 값은 불변이라 바꿀 수 없다.A primitive value is immutable and cannot be changed.

  41. 참조chamjo

    reference레풔런스

    값을 직접 담는 대신 값이 있는 자리를 가리키는 것Pointing at where a value is, instead of holding the value itself

    객체는 참조로 넘어간다.An object is passed by reference.

  42. 래퍼 객체 (감싼 객체)raepeo gaekche

    wrapper object래퍼 아브젝트

    원시 값에 점을 찍었을 때 잠깐 생기는 객체The object that appears for a moment when a primitive is used with a dot

    문자열에 점을 찍으면 래퍼 객체가 잠깐 생긴다.A dot on a string makes a wrapper object for a moment.

  1. Q자바스크립트는 어디서 도니?jabaseukeuripteuneun eodiseo doni?Where does JavaScript run?웨어 더즈 자바스크립트 런

    A브라우저와 서버 둘 다에서 돈다. 언어는 같고, 쓸 수 있는 바깥 기능이 다르다.beuraujeowa seobeo dul daeseo donda. eoneoneun gatgo, sseul su inneun bakkat gineungi dareuda.In the browser and on a server. The language is the same; what is available around it differs.인 둬 브라우저 앤드 안 어 서붜. 둬 을랭궈지 이즈 둬 세임 왓 이즈 어붸일러블 어라운드 잇 디풔즈.

  2. QECMAScript 와 자바스크립트는 뭐가 달라?ECMAScript wa jabaseukeuripteuneun mwoga dalla?How do ECMAScript and JavaScript differ?하우 두 엑마스크립트 앤드 자바스크립트 디풔

    AECMAScript 는 언어 자체를 적어 둔 표준의 이름이고, 자바스크립트는 그 표준을 따르는 언어다.ECMAScript neun eoneo jachereul jeogeo dun pyojunui ireumigo, jabaseukeuripteuneun geu pyojuneul ttareuneun eoneoda.ECMAScript is the name of the standard for the language; JavaScript is the language that follows it.엑마스크립트 이즈 둬 네임 어븨 둬 스탠더드 푀 둬 을랭궈지 자바스크립트 이즈 둬 을랭궈지 됏 퐐로즈 잇.

  3. Q식과 문은 어떻게 가려?sikgwa muneun eotteoke garyeo?How do you tell an expression from a statement?하우 두 유 텔 앤 익스프레션 픠럼 어 스테잇먼트

    A값 하나로 셈해지면 식이고, 일을 시키면 문이다. 식은 문 안에 들어간다.gap hanaro semhaejimyeon sigigo, ireul sikimyeon munida. sigeun mun ane deureoganda.If it works out to a value it is an expression; if it tells the machine to do a thing it is a statement.이픠 잇 워크스 아웃 투 어 봴류 잇 이즈 앤 익스프레션 이픠 잇 텔즈 둬 머쉰 투 두 어 씽 잇 이즈 어 스테잇먼트.

  4. Q세미콜론을 꼭 찍어야 해?semikolloneul kkok jjigeoya hae?Do semicolons have to be written?두 세미코울런즈 해븨 투 비 리튼

    A엔진이 대개 알아서 넣어 준다. 그래도 한 가지로 정해 두고 그대로 지키는 쪽이 읽기 편하다.enjini daegae araseo neoeo junda. geuraedo han gajiro jeonghae dugo geudaero jikineun jjogi ikgi pyeonhada.The engine mostly adds them. Still, pick one habit and keep it: it reads better.둬 엔전 모우스틀리 애즈 뒘. 스틸 픽 원 해빗 앤드 킵 잇 잇 리즈 베터.

  5. Q주석에는 무엇을 적어?juseogeneun mueoseul jeogeo?What goes in a comment?왓 고우즈 인 어 카멘트

    A무엇을 하는지는 코드가 말한다. 주석에는 왜 그렇게 했는지를 적는다.mueoseul haneunjineun kodeuga malhanda. juseogeneun wae geureoke haenneunjireul jeongneunda.The code says what it does. A comment says why it was done that way.둬 코우드 세즈 왓 잇 더즈. 어 카멘트 세즈 와이 잇 워즈 던 됏 웨이.

  6. Q엄격 모드는 왜 켜?eomgyeok modeuneun wae kyeo?Why turn strict mode on?와이 턴 스트릭트 모우드 안

    A느슨한 옛 규칙을 끄고 실수를 바로 에러로 알려 주기 때문이다. 모듈 안은 늘 엄격 모드다.neuseunhan yet gyuchigeul kkeugo silsureul baro ereoro allyeo jugi ttaemunida. modyul aneun neul eomgyeok modeuda.It turns off loose old rules and reports mistakes as errors. Inside a module it is always on.잇 턴즈 오픠 을루스 오울드 룰즈 앤드 리포츠 미스테이크스 애즈 에러즈. 인사이드 어 마줄 잇 이즈 올웨이즈 안.

  7. Q에러 메시지를 어떻게 읽어?ereo mesijireul eotteoke ilgeo?How do you read an error message?하우 두 유 레드 앤 에러 메서지

    A첫 줄에서 어떤 에러인지, 그 밑에서 어느 파일 몇 번째 줄인지 본다. 끝까지 읽는 것이 먼저다.cheot jureseo eotteon ereoinji, geu miteseo eoneu pail myeot beonjjae jurinji bonda. kkeutkkaji ingneun geosi meonjeoda.The first line says which error, the lines under it say which file and line. Read it to the end first.둬 풔스트 을라인 세즈 위치 에러 둬 을라인즈 언더 잇 세이 위치 퐈일 앤드 을라인. 레드 잇 투 둬 엔드 풔스트.

  8. Q부수 효과가 왜 중요해?busu hyogwaga wae jungyohae?Why do side effects matter?와이 두 사이드 이풱츠 매터

    A값만 돌려주는 코드는 다시 돌려도 같다. 바깥을 바꾸는 코드는 차례와 횟수까지 맞아야 한다.gamman dollyeojuneun kodeuneun dasi dollyeodo gatda. bakkateul bakkuneun kodeuneun charyewa hoetsukkaji majaya handa.Code that only gives a value is the same when run again. Code that changes the outside depends on order and count.코우드 됏 온리 기븨즈 어 봴류 이즈 둬 세임 웬 런 어겐. 코우드 됏 체인지즈 둬 아웃사이드 디펜즈 안 오더 앤드 카운트.

  9. Q명세는 코드보다 먼저 적어?myeongseneun kodeuboda meonjeo jeogeo?Does the specification come before the code?더즈 둬 스페시퓌케이션 컴 비푀 둬 코우드

    A그렇다. 무엇을 만들지 말로 못 적으면 나온 코드가 맞는지 판단할 기준이 없다.geureota. mueoseul mandeulji mallo mot jeogeumyeon naon kodeuga manneunji pandanhal gijuni eopda.Yes. If you cannot write what to build in words, you have no measure for whether the code is right.예스. 이픠 유 캐낫 라잇 왓 투 빌드 인 워즈 유 해븨 노우 메저 푀 웨둬 둬 코우드 이즈 라잇.

  10. Q표준을 보고 쓰는 게 왜 나아?pyojuneul bogo sseuneun ge wae naa?Why is it better to work from the standard?와이 이즈 잇 베터 투 워크 픠럼 둬 스탠더드

    A표준에 적힌 것은 엔진이 바뀌어도 그대로다. 한 브라우저에서만 되는 것은 언제 사라질지 모른다.pyojune jeokin geoseun enjini bakkwieodo geudaeroda. han beuraujeoeseoman doeneun geoseun eonje sarajilji moreunda.What is in the standard stays as the engines change. What works in one browser only may vanish.왓 이즈 인 둬 스탠더드 스테이즈 애즈 둬 엔전즈 체인지. 왓 워크스 인 원 브라우저 온리 메이 봬니시.

  11. QAI 가 브라우저에만 있는 기능으로 짰어. 서버에서도 돌려야 하는데.AI ga beuraujeoeman inneun gineungeuro jjasseo. seobeoeseodo dollyeoya haneunde.AI used something that exists only in the browser, but it has to run on a server too.에이아이 유즈드 섬씽 됏 이그지스츠 온리 인 둬 브라우저 벗 잇 해즈 투 런 안 어 서붜 투.

    A언어에 있는 것과 돌아가는 자리가 주는 것을 가른다. 표준에 있는 것만 쓰고, 바깥 기능은 한 자리에 모아 둔다.eoneoe inneun geotgwa doraganeun jariga juneun geoseul gareunda. pyojune inneun geonman sseugo, bakkat gineungeun han jarie moa dunda.Tell what the language has from what the runtime gives. Use only what is in the standard and gather the outside abilities in one place.텔 왓 둬 을랭궈지 해즈 픠럼 왓 둬 런타임 기븨즈. 유스 온리 왓 이즈 인 둬 스탠더드 앤드 개둬 둬 아웃사이드 어빌러티즈 인 원 플레이스.

  12. QAI 가 주석을 줄마다 달아 줬어.AI ga juseogeul julmada dara jwosseo.AI put a comment on every line.에이아이 풋 어 카멘트 안 에붜리 을라인.

    A무엇을 하는지 적은 주석은 지운다. 코드가 이미 말한다. 왜 그렇게 했는지만 남긴다.mueoseul haneunji jeogeun juseogeun jiunda. kodeuga imi malhanda. wae geureoke haenneunjiman namginda.Delete the comments that say what it does: the code already says it. Keep only why.딜릿 둬 카멘츠 됏 세이 왓 잇 더즈 둬 코우드 올레디 세즈 잇. 킵 온리 와이.

차례 — 17장Contents — 17 chapters

  1. 0처음Getting Started
  2. 1값과 타입Values and Types
  3. 2변수와 범위Variables and Scope
  4. 3연산자와 비교Operators and Comparison
  5. 4함수Functions
  6. 5객체Objects
  7. 6배열Arrays
  8. 7클래스와 프로토타입Classes and Prototypes
  9. 8반복Iteration
  10. 9오류 처리Handling Errors
  11. 10비동기Asynchronous
  12. 11모듈Modules
  13. 12JSON 과 날짜JSON and Dates
  14. 13정규식Regular Expressions
  15. 14DOM 과 이벤트The DOM and Events
  16. 15fetch 와 네트워크Fetch and the Network
  17. 16시험·디버깅·AI 와 일하기Tests, Debugging, and Working with AI
봇트레이드가 낸 책 모두 보기Every book from BotTrade→