« first day (4123 days earlier)      last day (810 days later) » 

2:40 AM
 
 
4 hours later…
6:35 AM
@DaMaxContent Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. 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
@DaMaxContent 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.
1 message moved to Trash can
@DaMaxContent Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. 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
@DaMaxContent Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. 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
1 message moved to Trash can
 
Is this intentional that this doesn't work?

https://gist.github.com/smartguy1196/209b159450da3caafa186b0bd1e76041
 
 
5 hours later…
 
2 hours later…
1:54 PM
@DaMaxContent I guess? Not sure why the example is that long though, it's literally just let table = Object.assign( {}, table ) which causes the problem. And the error should tell you why - the code is trying to access table before it's declared. Because it's accessing it at declaration time.
Unless the example tries to show off something different in which case it fails because of the error.
 
 
3 hours later…
5:25 PM
0
Q: Class-Validator (Node.js) Get another property value within custom validation

Hassan AlthafAt the moment, I have a very simple class-validator file with a ValidationPipe in Nest.js as follows: import { IsDateString, IsEmail, IsOptional, IsString, Length, Max, } from 'class-validator'; export class UpdateUserDto { @IsString() id: string; @Length(2, 50) @IsString() ...

 
 
3 hours later…
8:50 PM
I have an issue with mapping React Routes
I am using React Router 6
  <Layout>
    <Routes>
      {routes.map(({ path, component }, key) => {
        <Route key={key} path={path} element={{ component }} />;
      })}
    </Routes>
  </Layout>
 
@MileMijatović Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. 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.
 
ReactDOM.render(
  <BrowserRouter>
    <App />
  </BrowserRouter>,
  document.getElementById("root")
Warning from console - No routes matched location "/"
 
 
2 hours later…
10:46 PM
Hey. is there a type system for js (alternative to typescript)?
 
@deostroll Flow
Although, it's more or less TS in that you still write some code with type annotations in it which is then compiled into regular JS. It's not 1:1 with TS but the approach is similar.
 
So how does it work with frameworks like nodejs? I meant do we get type-checking for stuff we put into arguments for creating a new Socket (for e.g.)...?
 
Alternatively, you could write regular JS and just annotate your code with JSDoc. Most big editors will understand it and warn you that you're passing a string to a function that expects a number, for example.
@deostroll Flow is a compile-time check, just like TS. JSDoc based solutions might be compile time if you have some compile step that parses and checks them. Or you need to trust your editor (you might need a plugin for your editor. Tern.js was a really big one that did type validation)
There is no runtime compile check, if that's what you're asking.
 
Not runtime. More like while working in the code editor itself...
Or a step in the transpilation stage...
 
11:04 PM
Then...why not TS? You can run it on JS code only, if you wish. It can work off the JSDoc to scan the types.
 

« first day (4123 days earlier)      last day (810 days later) »