Basic JS methods not recognized?
Working on my first javascript program so bare with me :)
Error on both red methods is "Cannot resolve method..." but they seem rather basic javascript methods? (see first screenshot)

I already tried the following.
- I tried the "File | Invalidate Caches / Restart" opton, no solution.
- I reinstalled IntellJ Idea (and wen't so version 2019.2, no solution
- I think i got the jdk installed correctly (see second screenshot)

How do I get this basic javascript methods working?
TIA
ABBOV.
Please sign in to leave a comment.
Sorry, but this is Java code, not JavaScript? and you are editing .java file, aren't you?
Try changing your code as follows:
Hi Elena,
Thanks for your aswer, unforetunaly this gives me sort of the same error? here the 'contains' method is also not recognized. I trying this because of the fact that I'm not getting the the named objects to work?
What I realy would like to do is to create an array, filled with objects whicht contains multiply datatypes, something like this:
public void teamAanmaken() {int teamNr;
String inOut;
int postNr;
String date;
var allTeams = [
{teamNr: 101, inOut: "IN", postNr: 1, date: "31-07-2019, 22:13"}
{teamNr: 101, inOut: "OUT", postNr: 1, date: "31-07-2019, 22:25"}
{teamNr: 102, inOut: "IN", postNr: 1, date: "30-07-2019, 17:45"}
{teamNr: 301, inOut: "IN", postNr: 2, date: "30-07-2019, 18:45"}
];
Is this something that is possible? I found this piece of code online but it does not seem to work in IntelIJ ?
>here the 'contains' method is also not recognized
it is recognized for me. Did you import the java.util.*? What does your class look like? Please provide a complete code snippet
Your
var allTeams = [{}]is a JavaScript code, what makes you think that adding it to java method can work?
Hi Elena,
Here's my total code, please bare with me, these are my first steps on javascripting. :)
At this moment purely based on the console, no HTML yet.
>Here's my total code, please bare with me, these are my first steps on javascripting.
This is (mostly) Java, NOT JavaScript!!!
var allTeams = [{}] is JavaScript, everything else is Java. You can't mix both.
Before moving on, let's decide on a language your are going to use, environment, things you are going to accomplish, etc.