What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-14 00:15:23
cache variables that need calculation
// In the case of a jQuery selector, we could cache the DOM element. let navright = document.querySelector('#right'); let navleft = document.querySelector('#left'); let navup = document.querySelector('#up'); let navdown = document.querySelector('#down'); Add solution -
Other 2021-09-28 13:52:02
angular directive vs component
Components ARE Directives. They are an extenison of directives with their own template and features. They are used for different things. Main differences: Components: - Have their own shadow DOM (an encapsulated template). - Only one component can be pr... Add solution