Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 11 months ago.
Improve this question
i am uisang this code:
Class Addition {
constructor () {
}
add (a = 1, b = 1) {
console.log(a+b)
}
}
but it geeve aan error
Uncaught SyntaxError: Unexpected identifier
Syntax is wrong, class should be in lowercase:
class Addition {
constructor () {
}
add (a = 1, b = 1) {
console.log(a+b)
}
}
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 months ago.
Improve this question
So i have this code
router.get('/invite/:invitecode', async(res,req) => {
return console.log(req.params)
if(!req.params.invitecode) {
return res.render('404')
}
if(!req.user) {
res.redirect(`/login?state=invite/${req.params.invitecode}`)
} else {
res.render('join')
}
})
And when I go to
http://localhost:3000/invite/fs
It is supposed to return fs as a param, but instead, it console.logs undefined
Why is this happening?
It does not work because you are accessing the Response object, you should flip the arguments
from:
async(res,req)
to
async(req,res)
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I've was given this is a multiple choice JS question. I said [], I just wanted to check if this is correct and if not why?
Consider this if statement:
if (loggedIn) {
body_classes = ["user-active"];
}
Which pair of characters in this code is optional?
""
()
{}
[]
The optional characters are the braces {}
if (loggedIn) {
body_classes = ["user-active"];
}
is the same as
if (loggedIn)
body_classes = ["user-active"];
If you remove the square brackets then body_classes becomes a string rather than an array.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I'm trying to get the console to read "No goal!" but every time I run it, I get "Goal". I'm guessing there's some basic syntax error that I'm making?
let isSoccerFan = false;
if (isSoccerFan=true) {
console.log("Goal!");
} else{
console.log("No goal!")
}
Your code is not correct. Try this:
let isSoccerFan = false;
if (isSoccerFan) {
console.log('Goal!');
} else {
console.log('No goal!');
}
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I was trying to make some object into objects , but there's a problem with my syntax.
That's the code:
var friends = {
bill : {
firstName:"Bill",
lastName:"Gates",
number:00158965478
},
steve :{
firstName:"Steve",
LastName:"Jobs"
number:00125688977
},
Joe: {
firstName:"Joe",
LastName:"Erabti",
number:0021625804429
}
};
You forgot the comma after last names of Jobs.. So its suppose to be like this:
var friends = {
bill : {
firstName:"Bill",
lastName:"Gates",
number:00158965478
},
steve :{
firstName:"Steve",
LastName:"Jobs", //<-- You previously forgot it here
number:00125688977
},
Joe: {
firstName:"Joe",
LastName:"Erabti",
number:0021625804429
}
};
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I'm trying to use a function inside another function. Right now, setPanodatas() appears as not defined:
function setPoints(obj, prop) {
// Some code
if (unzippedNewPanodatas)
unzippedNewPanodatas = unzippedNewPanodatas.slice(scope.panodatas.length)
_.each(unzippedNewPanodatas, function(point) {
var Panodata = AV.Object.extend('PanoramaData')
var panodata = new Panodata()
obj[prop].push(setPanodatas(panodata.toJSON(), point))
})
}
function setPanodata(panodata, point) {
panodata.set('index', point.index)
panodata.set('x', offsetX(point.x))
panodata.set('y', offsetY(point.y))
panodata.set('roomModelId', scope.pano.id)
panodata.set('panoDataRotate', 0)
panodata.set('differentLayout', false)
panodata.set('panoCount', 6)
panodata.set('type', 'VRoom')
console.log('PANODATA', panodata)
return panodata
}
Why isn't setPanodata() visible inside setPoints()?
It is because setPanodatas is undefined.
Rather it is setPanodata, you added s.
function setPanodata(panodata, point)