Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Do you mean nodejs or just plain js?
if(answer === "JavaScript"){
console.log("https://stackoverflow.com/questions...");
}elseif(answer === "nodejs"){
console.log("https://stackoverflow.com/questions...");
}else{
console.log("try reading docs of the thing you are using");
} -
donnico12197yOGM js sucks! Dafuq man, try to import in python.
I believe you wanted to say omg I suck at js. -
inaba45897yHow to not ask a programming question, by OP.
If you want a good reply you naught need to tell us emphasis("what") is happening and emphasis("what") you're doing.
"My code aint workin'" isn't enough.
"This code I wrote aint workin'"is better
"This code aint workin' I'm gettin' this error:" is better
"This code aint workin', I'm gettin' this errpr and I've tried this this and that and it aint workin'" is the best -
@inaba i am trying web3js, truffle and importing them into my app. see the pic
but in console it is giving me error: unexpected token -
donnico12197y@adeshgautam man I don't know if you are using some fancy webpack plugin but I don't think you are doing import correctly.
You want to drop those curly since u are using default anyhow or use as outside of them:
import default as yourname from 'module'
Or import { exportedName } as yourname from 'module'
Also do not mix require and import. -
donnico12197y@adeshgautam I double checked and you actually can use as inside the curly, but now with default.
Protip: you can always use import * as all from 'yourmodule'
And then console.log(all) and you can see the structure of your module completely.
ftw !!!! js sucks
importing js files giving errors 😐
used require(blah_blah) and
import { blah_blah as blah } from blah
How do I do it ?😶
rant