Ask coding questions

← Back to all posts
why isn't my database saving data?
obcburger (0)

it's in java
im sorta new to java but i have experience with other languages
however i do think this db should save data, i just don't know why it doesn't
the code works smoothly, keys exist and the key is valid, it just doesn't save any data in it for whatever reason. the array is not invalid either. when "dabv2" is printed after getting, it either says "null" "undefined" or "[]"

this is what the array looks like that\s meant to be saved but isnt:

(don't mind the amount of inventory slots i'm using because that currently isn't my main concern, i can change it anytime.)

Comments
hotnewtop
obcburger (0)

my bad, not java it's js/node.js
i forgot they're two different things

Carnage498 (58)

yea like the other guys said, this is javaSCRIPT(also known as JS)
Java and JavaScript are different things. At the basis, JS is a scripting language not programming. And Java is a programming language. HERE(https://www.google.com/search?client=opera&q=difference+between+java+and+javascript&sourceid=opera&ie=UTF-8&oe=UTF-8). So you are doing the entirely wrong stuff @obcburger. Hope you understand and mark if helped! ~ @Carnage498

obcburger (0)

@Carnage498 ^^ "my bad, not java it's js/node.js
i forgot they're two different things"

Coder100 (18903)

this isn't java
this is js!

VulcanWM (2898)

The language of the repl is node.js-?