JavaScript Flashcards
What is JavaScript
Javascript is a programming language that allows us to implement complex features on the web by integrating with HTML and CSS
what is CI / CD
CI/CD stands for Continuous Integration and Continuous Deployment/Delivery. It is a set of practices and processes used in software development to automate the building, testing, and deployment of applications
What is regex
Is a tool used to
-Matching specific patterns in strings (e.g., email addresses, phone numbers, URLs)
-Searching and replacing text within a larger body of text
-Validating input data against specific patterns or formats
-Extracting specific portions of text from a larger string
what is AJAX?
Is a technique of accessing web servers from web page, it allows us:-
- update the web page without reloading the whole page
- request and receive data from a server after the page has loaded
- and also we can send data from the server in the background
What is the latest version of JavaScript?
The latest version of JavaScript is ES6 and it has some new features like arrow Functions, Template literals, classes, let and const, destructing, default parameters, rest, promises (like asynchronous), modules. And those new features make JavaScript easy to write code and debag.
Data Types in JavaScript:
JavaScript have two types of data types primitive and non-primitive,
primitives are:
* Boolean
* String
* Number
* Null
* Undefined
Non-primitives are:
* Object
* Array
* Functions
What are the difference between undifiend and null?
Undefined is a return we get when we try execute a variable that have no value it return undefined because the excuter found the variable on the memory space
Null in other hand is used to represent intentional absence of a value. Often used to indicate that a variable or object property has ben delebretly set no value.
What are Array methods?
Push, pop, shift, unshift,slice
What are the string methods?
CharAt, concat, indexOf, substring, replace, toUpperCase
what are the object methods?
Object.keys(), Object.values(), Object.entries(), Objec.assighn()
How do you clone objects?
- Spread operator {…}
- Object.assign()
Const obj = {name: “john”, age:30}
Const obj2 = Object.assign({}, obj1) - JSON.parse() and JSON.stringify()
Const obj = {name: “john”, age:30}
Const obj2 = JSON.parse(JSON.stringify(obj1)
What is Map, reduce, and filter
They are a higher-order function that applied on an array
map:- retrurns a new transformed/modified array based on a provided callback function
filter:- returns a new filtered array containing only an element that passed a provided condition
reducer:- return a single output, it accepts accumulator and current element and returns the updated accumulated value
what are call, apply and bind?
They are a methodes used to manuplate how functions are invoked and how they reference the “this” value
call:- allow us to invoke a value with a specified “this” value and argument provieded
Syntax:-
function.call(thisArg, arg1, agr2, …)
apply:- similar to call but it accept arguments as an array or array-like element
Syntax:-
function.apply(thisArg, [argumentsArr])
bind:- returns a new function with a specified this,
Syntax:-
function.bind(thisArg, optionalArguments)
what is Hoisting?
Hoisting is a javascript behaviour where variables and functions were moved to the top of the respective scope during the compilation phase, before the code is exuted. which means that regardless of wher the variable and the function declared with in their scope they allways declared as they declared at the begning of the scope.
What is variable Hoisting?
function decalration
sayHello() //hello
function sayHello(){
console.log(“hello”)
}
it only works when the function is declared using a function key word
when the variable declaration
console.log(number) //undifined
var nuber = 10
it doesen’t throw the error instade it return undified
what is lexical scope?
It is a programming principle that determaines variable accessebility based on their locations in the source code