Conditional

CONDITIONAL(조건문)

Always need ‘Comparison Operator’(비교 연산자)

  • > more than
  • < less than
  • >= ane more
  • <= and less
  • === equal
  • !== not equal
  • Result is always ‘boolean’(true/false)
  • else can be omitted depends on function.

To apply 2 conditions together, use ‘Logical Operator’(논리 연산자)

AND: &&

OR: ||

NOT: ! (falsy) **memorize

Number.isNaN(anything)

STRING METHODS = IMMUTABLE

  • If you do string type + any different type, it becomes string type automatically.

length,

find value,

  • if there is no value, it returns -1

lastIndexOf

  • find index from the back and check the order from the front.

str.includes(searchValue)

  • does not work at outdated browser and returns as Boolean

separate,

get certain values from the string,

Uppercase/Lowercase

Math

  • Math.floor(x) = 내림;
  • Math.ceil(x) = 올림;
  • Math.round(x) = 반올림;
  • Math.pow(base, exponent) = 제곱

trim() : remove space inside string

\n : new line

--

--

--

Consistency achieves everything https://github.com/paigekim29

Love podcasts or audiobooks? Learn on the go with our new app.

How to adaptively adjust the contrast of an image in Node.JS

Electron JS: How to create a beautiful frameless window

How to Add Conditional Statements to v-for Loops in Vue.js

.splice js

Modern Node Part 2 — Bootstrapping a Node.js

Bits and Ends — Javascipt Project (Flatiron)

Asynchronicity in JavaScript

5 Features to Look Out For in Future JavaScript Versions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Joo Hee Paige Kim

Joo Hee Paige Kim

Consistency achieves everything https://github.com/paigekim29

More from Medium

Collections

4 things to do when you are stuck in programming

OOP Pillars

Object-Oriented Programming