JavaScript

Z bur.sk
Skočit na navigaci Skočit na vyhledávání


   false
   const myConst = ...;
   let myVar = ...;
   arguments
   Math.floor(...)
   Math.random()
   `${myVar}`
   myString.startsWith('abc')
   myArray.join(',')

Array

   [1, 2, 3]
   Array(myLength.fill(myValue)  // tá istá hodnota
   Array.from(myArray)  // skopíruje hodnoty
   Array.from('abc')  // ['a', 'b', 'c']
   Array.from(mySet)
   Array.from(myMap)  // [[k1, v1], [k2, v2]]
   Array.from(myArray, (oldValue, index) => ...)  // upraví hodnoty
   Array.from({length: myLength}, (_, index) => ...)  // vygeneruje hodnoty
   myArray.push(...)
   myArray.forEach(item => ...)
   myArray.forEach((item, index) => ...)
   myArray.slice()
   myArray.slice(start, end)

Set

   new Set()
   mySet.size
   mySet.add(...)

Map

   myMap.keys()
   myMap.values()
   myMap.has(k)
   myMap.get(k)
   myMap.set(k, v)

DOM

   alert('...')
   document.getElementById('myId')
   document.querySelectorAll('img')
   document.querySelectorAll('.myClass')
   document.createElement('div')
   myCanvas.getContext('2d')
   myCanvas.getBoundingClientRect()
   myContext.clearRect(x, y, w, h)
   myContext.drawImage(image, x, y, w, h)
   myImage.src
   myButton.addEventListener('click', e => ...)
   myClickEvent.clientX
   myClickEvent.clientY
   myRectangle.left
   myRectangle.top
   myElement.innerHTML
   myElement.textContent
   myElement.classList
   myElement.style
   myElement.appendChild(...)