You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constfirst="FName",last="LName";functionshoutOutFor({ first, last }){console.log(`We would like for ${first}${last} to come to pick up his/her package`);}shoutOutFor();
A :D
Uncaught TypeError
We would like for FName LName to come to pick up his/her package
We would like for ${first} ${last} to come to pick up his/her package
Question 11:
Q : What does the console shows ?
constx=null;console.log(typeofx);
A :D
undefined
null
object
Question 12:
Q : What is the value of x ?
constx=Number.isNaN("text");console.log(x);
A :D
true
false
Uncaught TypeError
Question 13:
Q : how to check if elm is an array
A :D
Array.isArray(elm);
isArray(elm);
Array(elm);
Question 14:
Q : What is the wrong function declaration ?
A :D
functionname(){}
constname=()=>{};
function()=>{}
Question 15:
Q : how to pass a callback function inside another function :
take off the element who are positive and aren't a multiple of two
take off the element who are a multiple of two
Question 18:
Q : What are the two predefined event time related function that are built in javascript
A :D
setTimeout & setInterval
setClock & setTimeInterval
setTime & setIntervalOut
Question 19:
Q : What is a promise ?
A :D
It is an object that represents a task that will be completed in the future.
It is a contract between two objects that link them.
It is a function that catch Http requests.
Question 20:
Q : How to fulfill a promise manually ?
A :D
using the resolve parameter inside the Promise creation;
using the method then.
using the method next.
Question 21:
Q : How to reject a promise manually ?
A :T
using the method catch.
using the method then.
using the method finally.
Question 22:
Q : Which one of the answers doesn't explain what is an Async function ?
A :T
an asynchronous function that return a Promise
an asynchronous function that runs in the main stack
an asynchronous function that can be resolved by returning a value
Question 23:
Q : Which one of the answers doesn't apply on await ?
A :T
Can only be used inside async function.
Returns the rejected value of the promise (error).
Returns the fulfilled value of the promise.
Question 24:
Q : how to handle err for a block of code ?
A :T
try{/*block*/}catch(error){}
try{/*block*/}finally(error){}
catch(error){/*block*/}finally{}
Question 25:
Q : How to declare a private attribute in js classes ?
A :T
#attribute
_attribute
Attribute (first character in uppercase)
Question 25:
Q : How to inherit properties of another class into your new class ?
A :T
child extends parent
child : parent
child inherit parent
Question 26:
Q : What
vartext="Inherited Will, The Destiny of the Age, and The Dreams of the People. As long as people continue to pursue the meaning of Freedom, these things will never cease to be!",reg=/(?<!\w)\w{4}(?!\w)/g,elements=text.match(reg);
A :D
3
5
7
Question 27:
Q : How to import and export other models in Node js
A :T
import() & export()
require() and models.exports
include & export
Question 28:
Q : How to initialize a project in node ?
A :T
npm i
npm init
npm project
Question 29:
Q : Which one of the following answers doesn't allow you to install a package ?
A :T
npm i
npm install
npm init
Question 30:
Q : What is package.json main role
A :T
a file that save the details of project (packages , name ,author ...ect).
a file that installs packages for our project.
a file that lunches the project scripts.
Question 31:
Q : For What npm stands?
A :T
Node Project Manager
Node Package Manager
New Project Manager
New Package Manager
Question 32:
Q : how to add express to your project ?
A :T
npm i express
npm add express
npm express
node install express
Question 33:
Q : what does port in listen represent
app.listen(port,()=>{console.log(`Server started on ${port}`);});
A :T
the id of the app's process
the logical address of the application that uses network to communicate
Question 34:
Q : How to start a web application with express
A :T
express()
app()
server()
Question 35:
Q : How to create a router as a model in express ?
A :T
express.Router()
Router()
app.Router()
Question 36:
Q : What is morgan used for?
A :T
to debug Database queries
to debug http requests in express
to send files using express.
Question 37:
Q : What is mongoDB?
A :T
a Graph databases
Documents databases
Relational databases
Question 38:
Q : What is the command that list all the databases saved in the mongodb server? (command line)
A :T
show dbs
show collections
list databases
Question 39:
Q : What is the command that allow you to find data in users collection using lastName ? (command line)
A :T
db.users.find({lastName:"Someone's lastName"})
users.find({lastName:"Someone's lastName"})
db.find(users,{lastName:"Someone's lastName"})
Question 40:
Q : What is mongoose js ?
A :T
a package that provides a schema-based solution to model an application data in Mongodb.
a package that provides pictures of mongoose animal pictures.
a package that create API in Node js.
Question 41:
Q : How to connect to a mongodb database using mongoose?
A :T
mongoose.connect(uri)
mongoose.con(uri)
mongoose(uri)
Question 42:
Q : What is mongoose schema ?
A :T
a blueprint that allow us to create data with specific restrictions.
an object that lunch queries (find, create , delete ...)
Question 43:
Q : Which one of these isn't the way of creating a user data and save it in the DB ?
A :T
user.create({...data})
user = new user({...data}); user.save();
user.push({..data})
Question 44:
Q : Which one of these isn't the way of creating a user data and save it in the DB ?