We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
Seems I can't assign an array to a this. variable?
This gives me an error, for example:
this.color1 = [69,173,168];
It works fine though if I write something like:
this.color1 = "#23ee10";
Is that to be expected?
In pure Javascript this supposedly works ...
Thanksü
Answers
What
this
refers to here is entirely dependent on context - which you don't provide. It's typically a reference to the surrounding function; but you may have used a function to define a pseudo-class; or may even be using the new ECMAScript2015 class implementation. There are also cases wherethis
doesn't in fact reference what you expect....If you're working with the p5.js library then you are writing "pure javascript"...
Can you post a short, complete sketch that demonstrates the issue.
I'm trying to use colors with dat.gui:
https://workshop.chromeexperiments.com/examples/gui/#4--Color-Controllers
You still don't provide your context: i.e. your own code. Also did you notice this: