Skip to content
Advertisement

Tag: javascript

How do i extend the area of effect on my GLSL shader?

Im new to GLSL, and im writing my very first shader. The shader is written to be used with PIXIjs. I pretty much got the effect i want but it looks like the effect iv created is being masked and limited to the size of my sprite. see picture below.Can anybody tell me what im doing wrong? appreciate it see

for loop skipping one item in array in javascript

I am trying to make a function that removes strings from an array if they include a character in a certain other list Here is the code: Here I am trying to remove all the words that include the letter o. I created a temporary array in the function because it has happened to me before that a for loop

Uncaught SyntaxError: Invalid or unexpected token in Html button

I create a button dynamically through javascript. When I click on it I get the mentioned error. The button is created like this: When debugging it, I’ve tried to figure out what goes wrong when I create it. It seems to be in the part where I make the onclick event. Nothing seems odd when I set the id. This

Rendering random elements from an array in React

I am making a small react app with the help of Potter-API through which users can search for specific characters or spells. After fetching data from the API I am rendering 6 random items(characters/spells) which when clicked lead to a detailed view of the item(characters/spells), I’ve also added a button called randomize which when clicked renders a new set of

Negative lookahead RegEx limited to an exact number of characters

How can I limit a negative lookahead RegEx to an exact number of characters? For example, this sentence should be denied… This car is not that fast! while this one should be allowed… The car you are about to see may not be that fast, but it’s very beautiful! The RegEx should match any sentence that contains the word ‘car’,

Javascript function and expression function

This tiny Javascript program returns the sha256 hash of its text. Executed with Nodejs Erbium, it works as expected. However, after writing it I thought that the function expression was not needed and so I changed the data line with the following: stream.on(‘data’, shasum.update); And it crashes with a horrific error message: Javascript is very flexible with function calls, but

How can i write with for()

Can I write somehow with for() the months of the year, last year, and the after 3 years? Like 2019.januar, 2019.februar… etc, to 2023.december Answer Check out this code:

How can I adjust the window innerwidth according to the percentage?

I try to adjust the window.innerwidth according to percentage but I don’t know what to do. MY goal is depending on the size of window.innerwidth, change the backgroundcolor of html. window.innerwidth can’t use percentages when comparing? I tried like this. Answer “90%” isn’t a valid value for innerWidth property. I think you meant 90% of outerWidth. Try out the following

Advertisement