JavaScript:
· Variables with the let keyword (and const) are hoisted, but unlike var, don’t get initialized. They are not accessible before the line we declare (initialize) them. This is called the “temporal dead zone”. When we try to access the variables before they are declared, JavaScript throws a Reference Error.
· With arrow functions, this keyword refers to its current surrounding scope.
· The unary plus tries to convert an operand to a number True is 1, and false is 0. => +true returns 1.
· In JavaScript, all objects interact by reference when setting them equal to each other.
· In JavaScript, all object keys are strings (unless it’s a Symbol). Even though we might not type them as strings, they are always converted into strings under the hood.
· new Number() is a built-in function constructor. Although it looks like a number, it’s not really a number: it has a bunch of extra features and is an object.
· Functions are objects! (Everything besides primitive types are objects).
· You can’t add properties to a constructor like you can with regular objects. If you want to add property or method to a constructor use prototype.
· 3 phases of event propagation: Capturing > Target > Bubbling
· During the capturing phase, the event goes through the ancestor elements down to the target element. It then reaches the target element, and bubbling begins.
· JavaScript is a dynamically typed language: we don’t specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called implicit type coercion. Coercion is converting from one type into another.
· True > 7 (typically any number greater than 1) results FALSE since true is 1 and false is 0 in JavaScript.
· In Objects, FREEZE doesn’t allows you to modify existing property and add new one. Whereas SEAL allows you to modify the existing property but won’t allows you add new one.
· When testing equality, primitives are compared by their value, while objects are compared by their reference. JavaScript checks if the objects have a reference to the same location in memory.
· eval evaluates codes that's passed as a string. EX: eval (‘10*6’) which gives you 60.
· In Objects, if you have two keys with the same name, the duplicate key will be replaced with the last specified value.
· Target is the element that triggered the event. Current Target is element where event listener attached.
·
CSS:
Refer HTML/CSS portion: https://jsbin.com/cuyakix/edit?html,css,output
· ID: it is unique and it can be assigned to only one DOM element at a time. CLASS: it can be assigned to multiple elements on a DOM page. In terms of specificity ID will overtook class because of its uniqueness.
Get Nagarjun deepak’s stories in your inbox
Join Medium for free to get updates from this writer.
· POSITION: it requires a parent element to have position set to relative or absolute. FLOAT: it requires parent with clear fix applied and overflow hidden or to be floated itself. Both changes the DOM element flow in a page.
· DIV SPAN: applies for all the span tags inside the DIV, but DIV > SPAN: applies only to its direct children which is not for nested children.
JQUERY:
· What is the difference between $(document).ready and window on load: document ready is loaded earliest as HTML is done parsing. Also in window on load you can attach only one listener to it. On other hand document ready can have multiple listeners.
· HIDE: remove only from visibility but DOM still available it uses CSS display property, REMOVE: actually removes it from DOM tree. DETACH: its similar to REMOVE however its stores the target and its events. It works like when you detach you can assign the element to a variable and append it using the variable.
·
Functional Programming in JavaScript: https://codeprep.io/
· Pure Functions
A pure function avoids shared state, mutating state and side effects. With a pure function, if you are given the same inputs it always returns the same output.
· Shared State
Any variable or object that exists in a shared scope.
· Mutating State
Mutating is the terminology for changing the value of any item in state. A pure function should not mutate state. Instead it should change a copy of the state item and replace state with this new modified version.
· Side Effects
If a function modifies state this is called a side effect.
React JS:
· Why return multiple elements in React is not allowed: React implementation relies on constructing a tree like structure which it uses to for reconciliation. When you return multiple elements from React elements from the render method, the assumption that the tree will have one root node for the Component will no longer hold, hence making it difficult to process reconciliation algorithm.
· Why do I need import React statement even if I don’t use React explicitly: Using JSX (<App />) is just a syntactic sugar for React create Element (). So when your code is transpiled to pure JavaScript, references to react will appear there, so you need the import for that. So yes, you’re using it, although you don’t see it.
· React JS component names must begin with capital letters: n JSX, lower-case tag names are considered to be HTML tags.
· Request data from API: COMPONENT DID MOUNT.
· Lifting the state up: it allows to pass data between siblings” to “it allows you to have more pure-presentational components, which make re-usability easier.
·






