Full-Stack Questions - Nonceblox
Full-Stack Questions - Nonceblox
2. What would be the output of the below code? Support your answer with a reason.
console.log(1);
console.log(4);
3. Are these functions the same? Support your answer with a reason.
function foo1() {
return {
bar: "hello"
};
function foo2() {
return
bar: "hello";
4. Write a custom hook for toggling state [true → false & false → true].
Backend Questions
1. What is the error in the following code? Support your answer with a reason.
query(
clientName='picanteverde';",
function (id) {
query(
function (transactions) {
transactions.each((transac) => {
query(
transac.id
}`,
(error) => {
if (!error) {
console.log("success!!");
} else {
console.log("error");
);
});
);
);
2. What is the difference between the following lines of code? Support your answer with a
reason.
db.cars.save({motor:"6-cylinder",color:"black"})
db.cars.insert(_id: “123”{motor:"6-cylinder",color:"black"})
setTimeout(() => {
resolve();
}, timeout);
});
try {
} catch (err) {
await wait(timeout);
}}