Expected Output Example: Our word is Pokemon Pokemon (Regular word) P!k!m!n (Every 2nd letter is !) Nomekop (Reversed) pokemOn (Every 6th letter is uppercase) [Array of ASCII Values] I am sure that I have got reverse just fine but need help in figuring out uppercase and changing every 2nd letter and returning ASCII codes of the word. I would imagine
Tag: function
How do I store the content of a variable for later use in other function (Javascript)
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
How to return specified data in function? JavaScript
I have the following data structure in an array from Neo4j. I am trying to loop over the array, add specific data to a new array (finalList), and return the new array with this code. Every time I run the code, finalList is returned empty. How can I add the appropriate data to an array and have it returned inside
Typescript optional object argument craziness
so I am trying to make a object parameter optional, with optional props, and have a default value at the same time: this works fine, but notice that crazy function definition! Any way to not repeat so much code? Answer I would probably write this like this:
Using HTML and Javascript to make a concrete supplies calculator – Takes a value of both ____m3 and a select option (mpa) to give a total price
This is my first time asking a question on Stack Overflow so apologies if I get something wrong. I am currently building a web calculator for a concrete company. Here are the details of the inputs: There is a form with the following inputs: Input 1: Cubic Meters (m3) Input 2: Strength Input 1 takes a value between 0.1 m3
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
Checking same case in JavaScript
I was trying to solve a code wars kata called “Check same case”, and I’m not understanding what is wrong with my solution and why it doesn’t pass. The function should check: If either of the characters is not a letter, return -1 If both characters are the same case, return 1 If both characters are letters, but not the
How can I create a variable, from repetitive strhtml, then call it throughout the javascript file?
List item I am trying to clean up my code and I am wondering how should I go on about doing it. I have a var = strhtml by which I keep appending a data array on it and do a ().html() to replace it in AJAX. I am however unable to figure out the correct syntax to do this.
JavaScript – Child objects called by functions to update child objects
I am learning about objects and their scopes, I got confused and decided to make a D&D pathfinder character sheet for practice. I made the character sheet as an object, child objects for ability scores, strength/dexterity/intelligence/etc… and then base and modifier values. in D&D you use your base value to calculate your modifier value and the modifier is used throughout
javascript arguments passed as objects instead of strings
Please help me understand how this could happen: I think I’m passing simple strings to a Javascript function, but they are received as form objects! The first argument is the id of the form. The second argument is the name of an input. I’m expecting string string instead. Answer When you concatenate the variables into the onclick attribute, they will