# programming

**URL:** https://forum.kirupa.com/c/programming/41.md?page=37

[Latest](https://forum.kirupa.com/latest.md) · [Categories](https://forum.kirupa.com/categories.md)

**Page:** 38

---

## [Getting the direction in javascript](https://forum.kirupa.com/t/getting-the-direction-in-javascript/644474)

<div class="topic-metadata">

**Author:** [@HenryHell0](https://forum.kirupa.com/u/HenryHell0)\
**Replies:** 1\
**Last updated:** [October 6, 2020, 10:02pm UTC](https://forum.kirupa.com/t/getting-the-direction-in-javascript/644474 "2020-10-06T22:02:57Z")

</div>

Hello! Im trying to make a javascript pong game but when the ball(aka a square) hits one of the pong sticks, I don’t know which direction to make it go in. For example, if a ball bounces off the floor and it comes in(to …

---

## [Chapter 8 counter code not working](https://forum.kirupa.com/t/chapter-8-counter-code-not-working/644449)

<div class="topic-metadata">

**Author:** [@Yogendra\_Khopkar](https://forum.kirupa.com/u/Yogendra_Khopkar)\
**Replies:** 1\
**Last updated:** [October 5, 2020, 10:37pm UTC](https://forum.kirupa.com/t/chapter-8-counter-code-not-working/644449 "2020-10-05T22:37:41Z")

</div>

I am unable to get the code to display counter. I tried out the code and am getting error that “cannot read property strikes of undefined” below is the source code React!React!React! #container{…

---

## [Using Emojis in HTML, CSS, and JavaScript](https://forum.kirupa.com/t/using-emojis-in-html-css-and-javascript/637830)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 13\
**Last updated:** [October 3, 2020, 8:26pm UTC](https://forum.kirupa.com/t/using-emojis-in-html-css-and-javascript/637830 "2020-10-03T20:26:36Z")

</div>

by kirupa | 7 February 2018 From its humble beginnings in 1999, Emojis are all the rage these days. It's no longer something that only people half our age use to communicate. You and I use them all the time, and…

---

## [What does it mean to be done declaratively?](https://forum.kirupa.com/t/what-does-it-mean-to-be-done-declaratively/644418)

<div class="topic-metadata">

**Author:** [@shahab570](https://forum.kirupa.com/u/shahab570)\
**Replies:** 1\
**Last updated:** [October 2, 2020, 3:31pm UTC](https://forum.kirupa.com/t/what-does-it-mean-to-be-done-declaratively/644418 "2020-10-02T15:31:55Z")

</div>

I was reading the React “refs and the DOM” section. I don’t understand this line. “Avoid using refs for anything that can be done declaratively”. can anyone explain what does this line mean?

---

## [4 Images - 4 Text Boxes](https://forum.kirupa.com/t/4-images-4-text-boxes/644403)

<div class="topic-metadata">

**Author:** [@John\_Stern](https://forum.kirupa.com/u/John_Stern)\
**Replies:** 4\
**Last updated:** [October 1, 2020, 6:01pm UTC](https://forum.kirupa.com/t/4-images-4-text-boxes/644403 "2020-10-01T18:01:25Z")

</div>

So I tried my hand at writing a constructor function that places 4 images (the images are stand ins for rodents since said rodents can’t be found in the imageGetImage library) on the page with the following caption above…

---

## [Trying to code Snake Game](https://forum.kirupa.com/t/trying-to-code-snake-game/644316)

<div class="topic-metadata">

**Author:** [@HenryHell0](https://forum.kirupa.com/u/HenryHell0)\
**Replies:** 4\
**Last updated:** [September 25, 2020, 5:48pm UTC](https://forum.kirupa.com/t/trying-to-code-snake-game/644316 "2020-09-25T17:48:43Z")

</div>

Im mew to javascript and am trying to make a snake game. I have everything minus the loosing part. Heres my code: var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var gs = 20; var xpo…

---

## [How to increase the speed of opencart website?](https://forum.kirupa.com/t/how-to-increase-the-speed-of-opencart-website/644336)

<div class="topic-metadata">

**Author:** [@Rahul\_Kumar](https://forum.kirupa.com/u/Rahul_Kumar)\
**Replies:** 3\
**Last updated:** [September 25, 2020, 7:29am UTC](https://forum.kirupa.com/t/how-to-increase-the-speed-of-opencart-website/644336 "2020-09-25T07:29:20Z")

</div>

Hello everyone, I want to increase the speed of my website by uploading images on cloud CDN. Can anyone tell me how to do it? Is there any extension to do so? Thanks and Regards

---

## [Finding Elements In The DOM Using querySelector | KIRUPA](https://forum.kirupa.com/t/finding-elements-in-the-dom-using-queryselector-kirupa/636210)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 5\
**Last updated:** [September 24, 2020, 8:49am UTC](https://forum.kirupa.com/t/finding-elements-in-the-dom-using-queryselector-kirupa/636210 "2020-09-24T08:49:01Z")

</div>

As you saw in the JavaScript, the Browser, and the DOM tutorial, your DOM is nothing more than a tree-like structure made up of all the elements that exist in your HTML document: This is a companion discu…

---

## [Using codepen.io as a testbed...SOLVED](https://forum.kirupa.com/t/using-codepen-io-as-a-testbed-solved/644230)

<div class="topic-metadata">

**Author:** [@Brian\_Pettitt](https://forum.kirupa.com/u/Brian_Pettitt)\
**Replies:** 1\
**Last updated:** [September 19, 2020, 2:13am UTC](https://forum.kirupa.com/t/using-codepen-io-as-a-testbed-solved/644230 "2020-09-19T02:13:27Z")

</div>

EDIT: I was able to work out this issue. I had to change the \<div\>'s at the bottom to . I also think (but am not sure) that the spacing on the return statements is important. It seems to require them to be on the same li…

---

## [New Decorators for JS Proposal (Again)](https://forum.kirupa.com/t/new-decorators-for-js-proposal-again/644165)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 2\
**Last updated:** [September 16, 2020, 2:22am UTC](https://forum.kirupa.com/t/new-decorators-for-js-proposal-again/644165 "2020-09-16T02:22:10Z")

</div>

The proposal for decorators in JavaScript has been updated… again. This will mark, if my counting is correct, the 4th major revision of this specification. If anyone is curious about the previous 3 iterations, I have a…

---

## [Why don't work letterStyle ?](https://forum.kirupa.com/t/why-dont-work-letterstyle/644182)

<div class="topic-metadata">

**Author:** [@reexel](https://forum.kirupa.com/u/reexel)\
**Replies:** 3\
**Last updated:** [September 15, 2020, 9:46am UTC](https://forum.kirupa.com/t/why-dont-work-letterstyle/644182 "2020-09-15T09:46:22Z")

</div>

Hello, all! I read book from Kirupa. It contains this code: \<! DOCTYPE html\> \<html\> \<head\> \<meta charset="utf-8"\> \<title\>React\</title\> \<script src="https://unpkg.com/react@16/umd/react.development.js"\>\</s…

---

## [Bad Idea: Animating Text Size/Scale](https://forum.kirupa.com/t/bad-idea-animating-text-size-scale/644151)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 0\
**Last updated:** [September 13, 2020, 8:02am UTC](https://forum.kirupa.com/t/bad-idea-animating-text-size-scale/644151 "2020-09-13T08:02:29Z")

</div>

This is a companion discussion topic for the original entry at https://www.kirupa.com/animations/bad\_idea\_animating\_text\_size\_scale.htm

---

## [AVIF Images](https://forum.kirupa.com/t/avif-images/644111)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 3\
**Last updated:** [September 12, 2020, 5:47am UTC](https://forum.kirupa.com/t/avif-images/644111 "2020-09-12T05:47:59Z")

</div>

Someone from work just shared this and I thought it was pretty impressive: AV1 Image File Format (AVIF) (pronounced \[əˈ vif\]) is an image file format specification for storing images or image sequences compressed wit…

---

## [Recoil State Management for React](https://forum.kirupa.com/t/recoil-state-management-for-react/644135)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 0\
**Last updated:** [September 10, 2020, 2:38pm UTC](https://forum.kirupa.com/t/recoil-state-management-for-react/644135 "2020-09-10T14:38:14Z")

</div>

Recoil is the hot, new (experimental) state management library coming out of Facebook for React. Makes it easy to efficiently share state update across components using a useState-like Recoil hook. Example (partial) f…

---

## [addEventListener load for Dynamically Loaded Script](https://forum.kirupa.com/t/addeventlistener-load-for-dynamically-loaded-script/644091)

<div class="topic-metadata">

**Author:** [@Shraddha\_Ingale](https://forum.kirupa.com/u/Shraddha_Ingale)\
**Replies:** 5\
**Last updated:** [September 10, 2020, 7:37am UTC](https://forum.kirupa.com/t/addeventlistener-load-for-dynamically-loaded-script/644091 "2020-09-10T07:37:34Z")

</div>

I want to modify css of the container that loaded from dynamic script I tried to use myScript.addEventListener(“load”, scriptLoaded, false); but it is getting null values.

---

## [React Taxonomy](https://forum.kirupa.com/t/react-taxonomy/644097)

<div class="topic-metadata">

**Author:** [@GregB997](https://forum.kirupa.com/u/GregB997)\
**Replies:** 2\
**Last updated:** [September 7, 2020, 10:34pm UTC](https://forum.kirupa.com/t/react-taxonomy/644097 "2020-09-07T22:34:41Z")

</div>

All, Taxonomy. I love that word. Say it with me… Taxonomy. I think the first time I truly encountered that word was while I was working on my Masters Degree in CS. And I was forced to read thru the ACM ( as any…

---

## [Chrome Dev Tools Tricks for Front End Developers](https://forum.kirupa.com/t/chrome-dev-tools-tricks-for-front-end-developers/644083)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 0\
**Last updated:** [September 6, 2020, 5:54pm UTC](https://forum.kirupa.com/t/chrome-dev-tools-tricks-for-front-end-developers/644083 "2020-09-06T17:54:45Z")

</div>

This is a companion discussion topic for the original entry at https://www.kirupa.com/hodgepodge/chrome\_dev\_tools\_for\_frontend\_developers.htm

---

## [Out of Sync Async Initialization (Broken Router Part 2)](https://forum.kirupa.com/t/out-of-sync-async-initialization-broken-router-part-2/643995)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 1\
**Last updated:** [August 29, 2020, 5:04am UTC](https://forum.kirupa.com/t/out-of-sync-async-initialization-broken-router-part-2/643995 "2020-08-29T05:04:51Z")

</div>

Not too long ago I wrote about a problem dealing with JavaScript reference variables causing problems in a broken router. The solution was (largely) to fix a Router subclass (RouterSubclass) so that its initialize() sig…

---

## [Broken Router Post-mortem](https://forum.kirupa.com/t/broken-router-post-mortem/643960)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 0\
**Last updated:** [August 24, 2020, 3:18pm UTC](https://forum.kirupa.com/t/broken-router-post-mortem/643960 "2020-08-24T15:18:56Z")

</div>

Our team has recently been cracking down on the JavaScript errors that have been occuring in our application. Whenever a JS error occurs, we make sure it gets logged into our logging system. Then every week we take a lo…

---

## [Combining Strings and Variables](https://forum.kirupa.com/t/combining-strings-and-variables/643944)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 0\
**Last updated:** [August 23, 2020, 8:03pm UTC](https://forum.kirupa.com/t/combining-strings-and-variables/643944 "2020-08-23T20:03:58Z")

</div>

This is a companion discussion topic for the original entry at https://www.kirupa.com/javascript/combining\_strings\_variables.htm

---

## [Storing texts + positions in local storage](https://forum.kirupa.com/t/storing-texts-positions-in-local-storage/643878)

<div class="topic-metadata">

**Author:** [@ran09](https://forum.kirupa.com/u/ran09)\
**Replies:** 2\
**Last updated:** [August 18, 2020, 6:30am UTC](https://forum.kirupa.com/t/storing-texts-positions-in-local-storage/643878 "2020-08-18T06:30:21Z")

</div>

Hello Kirupa Thanks for your great site I am NOT a proffesional coder but I can learn and try to adupt to my needs, and I need your help. Now I want to build a tool called Future Wheel https://www.mindtools.com/pages/…

---

## [How to create an executable file](https://forum.kirupa.com/t/how-to-create-an-executable-file/643868)

<div class="topic-metadata">

**Author:** [@hash](https://forum.kirupa.com/u/hash)\
**Replies:** 1\
**Last updated:** [August 14, 2020, 8:26pm UTC](https://forum.kirupa.com/t/how-to-create-an-executable-file/643868 "2020-08-14T20:26:47Z")

</div>

Hi I have an open source code which was designed in React and I am trying find out how to make it into an executable file .exe The instruction which I was giving as following only go so far: 1/ Open cmd 2/ Go to dire…

---

## [Extracting a number from a line that represents a negative value](https://forum.kirupa.com/t/extracting-a-number-from-a-line-that-represents-a-negative-value/643836)

<div class="topic-metadata">

**Author:** [@mikevlk](https://forum.kirupa.com/u/mikevlk)\
**Replies:** 3\
**Last updated:** [August 11, 2020, 12:42pm UTC](https://forum.kirupa.com/t/extracting-a-number-from-a-line-that-represents-a-negative-value/643836 "2020-08-11T12:42:24Z")

</div>

i have a text document that is columnar in nature. one of the columns is up to 7 characters, with the 7th character if present being the dash “-” to represent a negative number. right now i am extracting the 7th charac…

---

## [kirupa.com - Hiding Mouse Cursor After Some Time](https://forum.kirupa.com/t/kirupa-com-hiding-mouse-cursor-after-some-time/399069)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 2\
**Last updated:** [August 11, 2020, 2:16am UTC](https://forum.kirupa.com/t/kirupa-com-hiding-mouse-cursor-after-some-time/399069 "2020-08-11T02:16:42Z")

</div>

by kirupa | 20 March 2011 Have questions? Discuss this Flash / ActionScript tutorial with others on the forums. This is a companion discussion topic for the original…

---

## [Comparing objects](https://forum.kirupa.com/t/comparing-objects/643750)

<div class="topic-metadata">

**Author:** [@Woodenshipandironman](https://forum.kirupa.com/u/Woodenshipandironman)\
**Replies:** 4\
**Last updated:** [August 2, 2020, 4:40pm UTC](https://forum.kirupa.com/t/comparing-objects/643750 "2020-08-02T16:40:19Z")

</div>

I’m looking for a function that compares two values. These values may or may not be objects. If they happen to be objects, I expect this function to verify that both objects have the same number of properties and that ea…

---

## [Question about React book. Can I remove li element by another way?](https://forum.kirupa.com/t/question-about-react-book-can-i-remove-li-element-by-another-way/643746)

<div class="topic-metadata">

**Author:** [@AlexGoryushkin](https://forum.kirupa.com/u/AlexGoryushkin)\
**Replies:** 1\
**Last updated:** [August 1, 2020, 11:14pm UTC](https://forum.kirupa.com/t/question-about-react-book-can-i-remove-li-element-by-another-way/643746 "2020-08-01T23:14:26Z")

</div>

Hello! I reading the React book from Kirupa. And now I’m in section 15, about TodoList app. According to the book, Event onClick is used for the li element to remove list items: createTasks(item) { return \<li onClick=…

---

## [Async/Await use in NodesJS and Mysql query](https://forum.kirupa.com/t/async-await-use-in-nodesjs-and-mysql-query/643670)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 2\
**Last updated:** [July 30, 2020, 8:32pm UTC](https://forum.kirupa.com/t/async-await-use-in-nodesjs-and-mysql-query/643670 "2020-07-30T20:32:26Z")

</div>

Hi guys, i am a bit confused when using Asyc/await, i am basically retrieving the data from the mysql DB and then use the information when constructing an object user\_details that i will use later. I have defined the A…

---

## [Beyond small animations](https://forum.kirupa.com/t/beyond-small-animations/643650)

<div class="topic-metadata">

**Author:** [@Woodenshipandironman](https://forum.kirupa.com/u/Woodenshipandironman)\
**Replies:** 5\
**Last updated:** [July 26, 2020, 3:45am UTC](https://forum.kirupa.com/t/beyond-small-animations/643650 "2020-07-26T03:45:51Z")

</div>

I have no background in computer science, I picked up JavaScript from an online tutorial and later from JavaScript: The Good Parts. I have an adequate understanding of the various parts of the language and syntax. I can …

---

## [JS Tip of the Day: ES2021 Preview](https://forum.kirupa.com/t/js-tip-of-the-day-es2021-preview/643632)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 0\
**Last updated:** [July 22, 2020, 3:00pm UTC](https://forum.kirupa.com/t/js-tip-of-the-day-es2021-preview/643632 "2020-07-22T15:00:31Z")

</div>

ES2021 Preview Version: ES2021 Level: Beginner This series of JavaScript tips started with a couple of new features that were introduced in ES2020. For this tip, the final tip in the series, we will take a look at a …

---

## [Cookies vs. localStorage vs. sessionStorage](https://forum.kirupa.com/t/cookies-vs-localstorage-vs-sessionstorage/643634)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 5:25am UTC](https://forum.kirupa.com/t/cookies-vs-localstorage-vs-sessionstorage/643634 "2020-07-23T05:25:02Z")

</div>

This is a companion discussion topic for the original entry at https://www.kirupa.com/hodgepodge/cookies\_local\_session\_storage.htm

[Previous page](https://forum.kirupa.com/c/programming/41.md?page=36)

[Next page](https://forum.kirupa.com/c/programming/41.md?page=38)
