I have been trying to make a simple Register/Login system in JS. I tried to get the username/password values through user inputs and turn them into variables using a register() function. After that, however, these variables no longer hold any value, and I need them to compare with the new login username/password to check if they match in order to
Tag: variables
Getting JavaScript file from Google Sheets
In my google sheet I entered below formulas in B1 and B2 Then these Cells become valid JS statements name = ‘Prabhu Paul’ ; and city = ‘India’ ; Then I published the Sheet in .csv format, below is the URL. And now I used this URL as the source file for my Script. The script added to site header
How to: Subtract a CSS value from a JS variable height?
How can I subtract from the navbar_height for example 2rem in the following function? Thanks! Answer You can use calc
how javascript handles variables in objects?
I have a question about declaring a variable in an object. Assuming that global or window is also an object, why is it not possible to declare a variable using let in an object that is a child of the window object? I do not understand that. Thanks for the answer and sorry for the English but I hope you
Proper variable name for find method [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 months ago. Improve this question I’m Japanese web developer. I’m currently thinking about the proper variable name for the result from javascript find method. I would
How I can reset variable value when function end?
I have such function and global variable (as array): Every call of this function push some data to array. In this function I use recursion. So how i can clear this array only when this function will end it’s work. Answer You can call the recursion function inside another function this way you can run anything you want when the
Is “” ( empty-string ) equivalent to boolean false or a false(y) value?
Please explain a little bit on this topic. I have went through some articles but I have not satisfied with their explanations. Answer The empty string (“”) returns falsy. An easy way to understand this is by using the logical AND operator The logical AND operator If the first object is falsy, it returns that object In the first console.log()
discordjs v13 – subtract the variable
The code doesn’t work when it subtract the variable (enemy’s health) This is my code I wonder at the damage – ene_health why it doesn’t subtract the enemy’s health I am using discord.js v13 and quickdb Answer isn’t doing anything. In your case you have to CHANGE the damage variable. or even better, use the Substract assignment :
How can I assign forEach to variable? Its possible?
Hello everyone:) I’m trying to write rock, paper, scissors game but I have a little problem. Is there any option to assign let playerChoice = buttons.forEach… to any variable as I did in this code? Unfortunately, it doesn’t work like this. I attached my code below. Thanks for any tips! Answer You can’t use forEach to do what you want
JavaScript – Confusion between global classes and inheritance
Total begginer who learns JS here. I don’t understand why when you declare a variable it doesn’t TOTALLY inherit of it’s parent class methods, for e.g.: Why don’t the variables inherit of all of the methods of it’s parent classes? Instead of that you need to mix between the fonctions of Array and myArr. They should be identitical on the