« first day (3692 days earlier)      last day (1239 days later) » 

12:28 AM
Popping in to say that I found a VLAZ in the wild
That and all the single quotes surrounding keys and values will lead to a parsing error. So you'd also have to replace them. But not if you have the string 'True, it\'s awesome!'VLAZ Mar 10 '19 at 15:26
Love running into acquaintances on main
 
 
8 hours later…
8:45 AM
hi guys some use angular?
*someone
 
 
2 hours later…
10:27 AM
Hello guys i need help with some code; codesandbox.io/s/useeffect-forked-3csw7?file=/src/Example.jsx i have a text "Hover me" , when i logged in and hover it it changes color as i want, but i want it to lose its onmouseover function after i logout,i tried to removeAttribute("onclick") but no solution
 
Has anyone setup angular core project on windows 10? up and running?
 
 
1 hour later…
ABC
11:35 AM
Hello.
 
@Tolima Instead of removing/adding handlers, why not just add the class based on your login state?
 
 
1 hour later…
12:43 PM
@BenFortune good point but i also need to destroy handler for other features in my normal project. codesandbox.io/s/useeffect-forked-3csw7?file=/src/Example.jsx , i played with it a little ,it works if i delete other component , but i dont know why
 
hey
I want to know if this is even a good idea. I want to check an array of strings for instances of words. For example an array like this ['2', '*', '4', '+', 'cancelled']
Would you use a regex here? I think checking if it's a word is a bit vague, maybe I should check against a list of known words
So in this case 'cancelled' would be a word I want to remove from the array
 
 
1 hour later…
2:18 PM
I don't know if there are any vue programmers out there, but I seem to have discovered a situation where true isn't true any more
This function returns true if val is zero and true if val is 1, as you might expect
	lessThanInvestment(val: number) : boolean {
		return val <= Number(this.model.amount);
	}
It's evaluated in the page like this:
v-else-if="!$v.validationFunctions.lessThanInvestment"
But that seems to fire when val is zero and not when val is 1. Any ideas what could be going on here?
 
2:40 PM
typescript: set.get('foo') should be typed to T | undefined, it isn't any clue what's happening here?
I mean map.get
 
3:19 PM
 interface Map<K, V> {
    get(key: K): V | undefined;
}
@ShrekOverflow Looks like it should be. What are you getting instead?
 
posted on November 24, 2020 by Nicholas C. Zakas

In the previous posts in this series, I discussed implementing a promise from scratch in JavaScript. Now that there’s a full promise implementation, it’s time to look at how you can monitor multiple promises at once using Promise.race() and Promise.any() (Promise.all() and Promise.allSettled() will be covered in the next post). You’ll see that, for the...

 
@phenomnomnominal nice spotify redesign :) but i miss being able to search from anywhere
 
4:06 PM
@JBis It just nignores the undefined, despite strictNullCheck being true.
I'm so confused, so I just ended up forcing strict that'll break the project though lol :D
 
Maybe typescript just trusts you so much that it knows it wont be undeifned ;)
@ShrekOverflow Hmm. I am getting type error with the following without stricNullCheck
const m = new Map<string, string>();
const a = m.get('test');
console.log(a.substring(2));
TS2532: Object is possibly 'undefined'.
 
Yeah that's just weird, I'll figure that out alter
Forcing strict for all doest hat but it just has been flaky overall
need to get my heads down into this (helping a startup get to beta, so don't want them to re-write the whole thing because of strict)
 
4:46 PM
posted on November 24, 2020 by Shelley Vohr

Notable Changes [6349b1d673] - (SEMVER-MINOR) dns: add a cancel() method to the promise Resolver (Szymon Marczak) #33099 [9ce9b016e6] - (SEMVER-MINOR) events: add max listener warning for EventTarget (James M Snell) #36001 [8390f8a86b] - (SEMVER-MINOR) http: add support for abortsignal to http.request (Benjamin Gruenbaum) #36048 [9c6be3cc90] - (SEMVER-MINOR) http2: allow setting the local wind

 
4:58 PM
posted on November 24, 2020 by Myles Borins

Notable Changes crypto: update certdata to NSS 3.56 (Shelley Vohr) https://github.com/nodejs/node/pull/35546 deps: update llhttp to 2.1.3 (Fedor Indutny) https://github.com/nodejs/node/pull/35435 (SEMVER-MINOR) upgrade to libuv 1.40.0 (Colin Ihrig) https://github.com/nodejs/node/pull/35333 doc: add aduh95 to collaborators (Antoine du Hamel) https://github.com/nodejs/node/pull/35542 fs: (

 
5:22 PM
|| mdn carot color
 
one question: why?
 
 
2 hours later…
7:06 PM
Hello everyone
I have dump ReactJS question
I am using useEffect and XMLHttpRequest to fetch data from API
and data will be displayed in select option dropdown
but I have a lot of issues because I can't display default value
for example, first element from the array
```
```
const App = () => {
  const [categoryData, setCategoryData] = useState([]);
  const [selectedCategory, setSelectedCategory] = useState();
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    const xhr = new XMLHttpRequest();

    const url = 'https://eonet.sci.gsfc.nasa.gov/api/v2.1/categories';
    xhr.open('GET', url);

    xhr.responseType = 'json';

    xhr.onload = () => {
      const data = xhr.response;
      setCategoryData(data.categories);
      setLoading(false);
 
@MileMijatović Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
I have an issue because I can not properly display the h1 title
its empty space from the start
 
@MileMijatović if you are using react you are probably using webpack, hopefully with with babel. As such you have no reason not to use fetch. Make your life easier.
@MileMijatović you have no initial value
you need to either set one or once the data is received set one by default
 
7:51 PM
JBis
I can set default value
but what's the goal of that ?
I can set up default value , but how can I know if that default value is the same as I will have from API
I am using XMLHttpRequest
@JBis
 
 xhr.onload = () => {
      const data = xhr.response;
      setCategoryData(data.categories);
      setLoading(false);
    };
in that, you should take the first category and set that one
that would be the initial value in this case. If you want something there while the api request is loading, then i would add a loading screen
 
8:26 PM
In the context of Node-RED, what are practical differences between the Mosquitto vs Mosca (now Aedes) MQTT brokers?

All I know is that Mosquitto might support bridging.
 
@adamaero Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
9:20 PM
Yes, you are right
@JBis
  xhr.onload = () => {
    const data = xhr.response;
    setCategoryData(data.categories);
    setSelectedCategory(data.categories[0].title);
    setLoading(false);
  };
 
@MileMijatović Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
this works good
but I have the same issue with description
@JBis
please see my code
 
9:40 PM
@MileMijatović what description?
 
no, show me code
 
const App = () => {
  const [categoryData, setCategoryData] = useState([]);
  const [selectedCategory, setSelectedCategory] = useState();
  const [selectedDescription, setSelectedDescription] = useState();
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    const xhr = new XMLHttpRequest();

    const url = 'https://eonet.sci.gsfc.nasa.gov/api/v2.1/categories';
    const fetchData = async () => {
      xhr.open('GET', url);

      xhr.responseType = 'json';

      xhr.onload = () => {
I can't fetch description for selected category
How can I do that ?
As you can see, I tried ` <p>{selectedDescription}</p>`
Do you have any idea ?
@JBis
 
its the same issue
you never set it
 
9:56 PM
I have
const [selectedDescription, setSelectedDescription] = useState();
but how to fetch description for specific title or id
I tried
  const handleChange = (event) => {
    setSelectedCategory(event.target.value);
    setSelectedDescription(event.target.value);
  };
just for test, but instead of description, I get the title
 

« first day (3692 days earlier)      last day (1239 days later) »