# programming

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

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

**Page:** 39

---

## [Console Logging an Arrow Function](https://forum.kirupa.com/t/console-logging-an-arrow-function/643633)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 3\
**Last updated:** [July 23, 2020, 3:32pm UTC](https://forum.kirupa.com/t/console-logging-an-arrow-function/643633 "2020-07-23T15:32:17Z")

</div>

I am a bit confused with the console output , my understading is that if we write the function name in the console it will display only if there is a return exisit and in this casue it will either display or parsed valu…

---

## [JS Tip of the Day: The Long Arrow Operator](https://forum.kirupa.com/t/js-tip-of-the-day-the-long-arrow-operator/643554)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 2\
**Last updated:** [July 22, 2020, 10:28am UTC](https://forum.kirupa.com/t/js-tip-of-the-day-the-long-arrow-operator/643554 "2020-07-22T10:28:50Z")

</div>

The Long Arrow Operator Level: Beginner Over the recent years, a lot of attention has been given to arrow functions, a feature introduced in ES2015. And rightfully so; they provide some exciting, new functionality and …

---

## [Looping Through an Array](https://forum.kirupa.com/t/looping-through-an-array/643607)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 0\
**Last updated:** [July 19, 2020, 4:00pm UTC](https://forum.kirupa.com/t/looping-through-an-array/643607 "2020-07-19T16:00:23Z")

</div>

This is a companion discussion topic for the original entry at https://www.kirupa.com/javascript/looping\_through\_array.htm

---

## [When saving data(array of objects) in React.State/ LocalStorage using ReactHooks, facing an error](https://forum.kirupa.com/t/when-saving-data-array-of-objects-in-react-state-localstorage-using-reacthooks-facing-an-error/643580)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 2\
**Last updated:** [July 17, 2020, 12:33am UTC](https://forum.kirupa.com/t/when-saving-data-array-of-objects-in-react-state-localstorage-using-reacthooks-facing-an-error/643580 "2020-07-17T00:33:53Z")

</div>

i am looking to save the customer product selection in basket and to avoid the effect of refesh of page i am also saving the customer selection to local storage, i am use spread ....prevItems and using window.localSt…

---

## [JS Tip of the Day: Async Generators](https://forum.kirupa.com/t/js-tip-of-the-day-async-generators/643582)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 0\
**Last updated:** [July 16, 2020, 3:56pm UTC](https://forum.kirupa.com/t/js-tip-of-the-day-async-generators/643582 "2020-07-16T15:56:09Z")

</div>

Async Generators Version: ES2018 Level: Advanced Normally, when next() is called in an iterator, it returns a result object (an object with value and done properties). This is by design as part of the iterator protoc…

---

## [kirupa.com - Creating A Button in Flash 5](https://forum.kirupa.com/t/kirupa-com-creating-a-button-in-flash-5/643573)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 1\
**Last updated:** [July 16, 2020, 6:25am UTC](https://forum.kirupa.com/t/kirupa-com-creating-a-button-in-flash-5/643573 "2020-07-16T06:25:29Z")

</div>

Adding A Button Unlike regular HTML, buttons are more than just simple navigation interfaces. In Flash, any object can be a button. Buttons not only provide feasible methods of taking the user to another page, but …

---

## [Column 80? Column 120? Other?](https://forum.kirupa.com/t/column-80-column-120-other/642721)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 10\
**Last updated:** [July 15, 2020, 12:51pm UTC](https://forum.kirupa.com/t/column-80-column-120-other/642721 "2020-07-15T12:51:46Z")

</div>

I started a new project at work last week and they have Prettier settings defined so I did my due diligence and made sure I’ve been formatting new source code files accordingly. One thing I noticed in doing so is that t…

---

## [Calculator in react using redux](https://forum.kirupa.com/t/calculator-in-react-using-redux/643561)

<div class="topic-metadata">

**Author:** [@Przemek88](https://forum.kirupa.com/u/Przemek88)\
**Replies:** 0\
**Last updated:** [July 15, 2020, 9:45am UTC](https://forum.kirupa.com/t/calculator-in-react-using-redux/643561 "2020-07-15T09:45:26Z")

</div>

I created a calculator in react. Now I would like to use the global instead of the local state - I know that this solution may not have a larger session, but I want to learn redux in this way. I prepared the action and t…

---

## [Arrays and Objects](https://forum.kirupa.com/t/arrays-and-objects/643542)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 0\
**Last updated:** [July 13, 2020, 7:01am UTC](https://forum.kirupa.com/t/arrays-and-objects/643542 "2020-07-13T07:01:49Z")

</div>

As we have seen so far, arrays are all about making it super simple to work with collections of data. This simplicity is partly through the various properties and methods available to us. It is also through the unique wa…

---

## [JS Tip of the Day: Default Parameter Scope](https://forum.kirupa.com/t/js-tip-of-the-day-default-parameter-scope/643536)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 1\
**Last updated:** [July 12, 2020, 6:25pm UTC](https://forum.kirupa.com/t/js-tip-of-the-day-default-parameter-scope/643536 "2020-07-12T18:25:31Z")

</div>

Default Parameter Scope Version ES2015 Level: Intermediate Normally, when function parameters are initialized in a function call, they’re scoped to the function body. However, when functions use default parameters, t…

---

## [JS Tip of the Day: Undefined vs. Null vs. Nullish](https://forum.kirupa.com/t/js-tip-of-the-day-undefined-vs-null-vs-nullish/643521)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 0\
**Last updated:** [July 10, 2020, 2:57pm UTC](https://forum.kirupa.com/t/js-tip-of-the-day-undefined-vs-null-vs-nullish/643521 "2020-07-10T14:57:23Z")

</div>

Undefined vs. Null vs. Nullish Level: Intermediate Both undefined and null are used to represent variables or properties as having no value. undefined is for properties which don’t exist or variables that have been dec…

---

## [Href use in API request and using subdomains](https://forum.kirupa.com/t/href-use-in-api-request-and-using-subdomains/643491)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 3\
**Last updated:** [July 10, 2020, 12:13pm UTC](https://forum.kirupa.com/t/href-use-in-api-request-and-using-subdomains/643491 "2020-07-10T12:13:14Z")

</div>

i am using Bootstrap in one of my react project and using Dropdown.Item as submenu it will fetch the desired search results and show on the browser just under the menu. as you see once i click the item it will take m…

---

## [JS Tip of the Day: Object.keys vs Array.keys](https://forum.kirupa.com/t/js-tip-of-the-day-object-keys-vs-array-keys/643508)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 0\
**Last updated:** [July 8, 2020, 3:14pm UTC](https://forum.kirupa.com/t/js-tip-of-the-day-object-keys-vs-array-keys/643508 "2020-07-08T15:14:30Z")

</div>

Object.keys vs Array.keys Version: ES2015 Level: Intermediate Object has a static method, Object.keys(), which will return all of the enumerable, non-inherited keys of any object as an array. This can be used to easi…

---

## [Reset the useState to initial state in ReackJS Hooks](https://forum.kirupa.com/t/reset-the-usestate-to-initial-state-in-reackjs-hooks/643492)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 3\
**Last updated:** [July 7, 2020, 8:16pm UTC](https://forum.kirupa.com/t/reset-the-usestate-to-initial-state-in-reackjs-hooks/643492 "2020-07-07T20:16:00Z")

</div>

i have got three option buttons and basically i am looking when one button is clicked the other two will reset to default , at now it is working but i have to manually set the state of other two but i guess there migh…

---

## [I've done some changes in code of React JS book, but](https://forum.kirupa.com/t/ive-done-some-changes-in-code-of-react-js-book-but/643476)

<div class="topic-metadata">

**Author:** [@AlexGoryushkin](https://forum.kirupa.com/u/AlexGoryushkin)\
**Replies:** 4\
**Last updated:** [July 7, 2020, 4:56pm UTC](https://forum.kirupa.com/t/ive-done-some-changes-in-code-of-react-js-book-but/643476 "2020-07-07T16:56:08Z")

</div>

Hello. Sorry for my English, I’ve just learning it. I’m reading the book about React JS. Thanks a lot to Kirupa for it! In the section 10 (about React events) there is an example of counter with button “+”: If I click …

---

## [Follow the Mouse Cursor](https://forum.kirupa.com/t/follow-the-mouse-cursor/636212)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 37\
**Last updated:** [July 7, 2020, 4:47pm UTC](https://forum.kirupa.com/t/follow-the-mouse-cursor/636212 "2020-07-07T16:47:57Z")

</div>

This is a companion discussion topic for the original entry at http://www.kirupa.com/canvas/follow\_mouse\_cursor.htm :slight\_smile:

---

## [HTML page to load ini file -- CORS!?](https://forum.kirupa.com/t/html-page-to-load-ini-file-cors/640162)

<div class="topic-metadata">

**Author:** [@gNeandr](https://forum.kirupa.com/u/gNeandr)\
**Replies:** 11\
**Last updated:** [July 7, 2020, 10:53am UTC](https://forum.kirupa.com/t/html-page-to-load-ini-file-cors/640162 "2020-07-07T10:53:24Z")

</div>

For a “simple” task I used an HTML page to control some wlan devices. All worked as expected, but recently it failed because the html file at startup was loading an ini file (using XHR). Nowadys CORS stricktly came in an…

---

## [A new, experimental frontend for React inspired by SwiftUI](https://forum.kirupa.com/t/a-new-experimental-frontend-for-react-inspired-by-swiftui/643477)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 1\
**Last updated:** [July 6, 2020, 8:08pm UTC](https://forum.kirupa.com/t/a-new-experimental-frontend-for-react-inspired-by-swiftui/643477 "2020-07-06T20:08:36Z")

</div>

Saw this come up on reddit this morning. Reminds me of the thread from a while back where I did something similar: SwiftUI

---

## [CSS index (table of contents?)](https://forum.kirupa.com/t/css-index-table-of-contents/643446)

<div class="topic-metadata">

**Author:** [@travis](https://forum.kirupa.com/u/travis)\
**Replies:** 1\
**Last updated:** [July 3, 2020, 5:07pm UTC](https://forum.kirupa.com/t/css-index-table-of-contents/643446 "2020-07-03T17:07:11Z")

</div>

I have occasionally seen a WordPress theme style or another stylesheet in the wild that has a beautiful index at the top: /\*\* \* Font styles: line 10 \* Headers: line 30 \* Content: line 120 \* Footer: line 451 \*\*/ Or some…

---

## [if else statement using state variable not working properly in ReactJS Hooks](https://forum.kirupa.com/t/if-else-statement-using-state-variable-not-working-properly-in-reactjs-hooks/643447)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 0\
**Last updated:** [July 2, 2020, 11:09pm UTC](https://forum.kirupa.com/t/if-else-statement-using-state-variable-not-working-properly-in-reactjs-hooks/643447 "2020-07-02T23:09:50Z")

</div>

Hi guys, i am facing an issue the condition that i am using in the return statement is both getting executed i.e first for few seconds \< SigninOptions /\> component and then the correct one as per the logic \< Useraccount …

---

## [Video Webcam Overlay](https://forum.kirupa.com/t/video-webcam-overlay/643438)

<div class="topic-metadata">

**Author:** [@tornad0](https://forum.kirupa.com/u/tornad0)\
**Replies:** 1\
**Last updated:** [July 2, 2020, 6:03am UTC](https://forum.kirupa.com/t/video-webcam-overlay/643438 "2020-07-02T06:03:44Z")

</div>

Hi all! I am just so amazed by this community, so cool. Will you please help me? I am trying to build a digital “magic mirror” that shows your webcam or front facing camera while a video WITH AUDIO plays ontop of it at …

---

## [Variable Scope Basics in JavaScript](https://forum.kirupa.com/t/variable-scope-basics-in-javascript/352579)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 2\
**Last updated:** [July 1, 2020, 7:14am UTC](https://forum.kirupa.com/t/variable-scope-basics-in-javascript/352579 "2020-07-01T07:14:41Z")

</div>

by kirupa | 20 February 2014 Let's revisit something relating to variables. Each variable you declare has a certain level of visibility that determines when you can actually use it. In human-u…

---

## [CSS Style- icon for login account](https://forum.kirupa.com/t/css-style-icon-for-login-account/643432)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 0\
**Last updated:** [June 30, 2020, 8:56pm UTC](https://forum.kirupa.com/t/css-style-icon-for-login-account/643432 "2020-06-30T20:56:02Z")

</div>

i am looking to design the SignIn option in my react Project, i came across one of the icon as solid image. i understand i can use it using className , css properties and using the script link from fontawesome.co…

---

## [kirupa.com - Using the DataGrid Component, Page 3](https://forum.kirupa.com/t/kirupa-com-using-the-datagrid-component-page-3/643416)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 0\
**Last updated:** [June 29, 2020, 4:58pm UTC](https://forum.kirupa.com/t/kirupa-com-using-the-datagrid-component-page-3/643416 "2020-06-29T16:58:28Z")

</div>

by kirupa | 23 July 2006 In the previous page, you learned how to dynamically add data to your DataGrid. On this page, you will learn how to sort numbers using the DataGrid component. The DataGrid component sor…

---

## [Differentiate redirect/JSON-data in response from fetch request](https://forum.kirupa.com/t/differentiate-redirect-json-data-in-response-from-fetch-request/643389)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 1\
**Last updated:** [June 28, 2020, 10:11pm UTC](https://forum.kirupa.com/t/differentiate-redirect-json-data-in-response-from-fetch-request/643389 "2020-06-28T22:11:47Z")

</div>

Hi Guys, i am trying to build a logic at front end to differentiate between the redirect and JSON response, the end goal for this is as, if the response is redirect go to that page and if the response is having data the…

---

## [PWA vs. React Native](https://forum.kirupa.com/t/pwa-vs-react-native/639724)

<div class="topic-metadata">

**Author:** [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Replies:** 7\
**Last updated:** [June 26, 2020, 9:08pm UTC](https://forum.kirupa.com/t/pwa-vs-react-native/639724 "2020-06-26T21:08:46Z")

</div>

Two of the hottest technologies for building cross-platform apps these days are Progressive Web Apps (PWA) and React Native. If you are an app developer today, which one should you prioritize and build for? What decision…

---

## [JSON parsing in Express](https://forum.kirupa.com/t/json-parsing-in-express/643355)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 2\
**Last updated:** [June 24, 2020, 10:37pm UTC](https://forum.kirupa.com/t/json-parsing-in-express/643355 "2020-06-24T22:37:21Z")

</div>

---

## [React using API call](https://forum.kirupa.com/t/react-using-api-call/643292)

<div class="topic-metadata">

**Author:** [@Umair\_Ashraf](https://forum.kirupa.com/u/Umair_Ashraf)\
**Replies:** 8\
**Last updated:** [June 24, 2020, 9:25pm UTC](https://forum.kirupa.com/t/react-using-api-call/643292 "2020-06-24T21:25:07Z")

</div>

Hi Guys, i am trying to build a project using React abd i was just trying to use the API calls in the React but i got stuck on the below code as it is returning an Error(items.then is not a function), i am using .then me…

---

## [Place 3 elements inside Flexbox](https://forum.kirupa.com/t/place-3-elements-inside-flexbox/643341)

<div class="topic-metadata">

**Author:** [@Helena\_G](https://forum.kirupa.com/u/Helena_G)\
**Replies:** 4\
**Last updated:** [June 24, 2020, 3:17pm UTC](https://forum.kirupa.com/t/place-3-elements-inside-flexbox/643341 "2020-06-24T15:17:17Z")

</div>

Hello. Can’t figure out why my code doesn’t work as I want. I have 3 elements. I want to place one element in the upper left corner, one in the right bottom corner and one element in the center using Flexbox. The cente…

---

## [JS Tip of the Day: Prototypes as Instance of Type](https://forum.kirupa.com/t/js-tip-of-the-day-prototypes-as-instance-of-type/643352)

<div class="topic-metadata">

**Author:** [@senocular](https://forum.kirupa.com/u/senocular)\
**Replies:** 0\
**Last updated:** [June 24, 2020, 12:34pm UTC](https://forum.kirupa.com/t/js-tip-of-the-day-prototypes-as-instance-of-type/643352 "2020-06-24T12:34:46Z")

</div>

Prototypes as Instance of Type Level: Advanced JavaScript uses prototypes for inheritance. Most of the time these prototypes are simply instances of ordinary objects, but there are some unusual exceptions. Some proto…

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

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