Landaylanday.hashnode.dev·Nov 25, 2024使用zod时的注意:nullable vs optional定义zod schema的时候,有时候定义为nullable时要注意:如果你是从一个可能为空的对象里取出一个字段来parse的时候,可能会出现问题: const schema = z.object({ a: z.string().nullable() }); const rawData = { nested: null }; const data = schema.parse({ a: rawData.nested?.a }); 会导致throw,程序无法继续下去。 解决办法:...Discusszod
Carmine Tambasciablog.allaroundjavascript.com·Aug 23, 2024What is Typescript 's exclamation(!) mark operator, or bag and how does it work?TL;DR The bang operator tells the compiler to temporarily relax the "not null" constraint that it might otherwise demand. It says to the compiler: "As the developer, I know better than you that this variable cannot be null right now". I think this qu...Discuss·28 readsTypeScript
Bhavesh Jadhavbhaveshjadhav.hashnode.dev·May 26, 2024JavaScript Concepts: Hoisting, this Keyword, and Undefined vs. Not DefinedJavaScript is a versatile and powerful language, but it comes with some concepts that can be tricky to understand. In this blog, we’ll explore three important concepts: hoisting, the this keyword, and the difference between undefined and not defined....Discuss·10 likesJavascript BasicsJavaScript
Ali slimanialienfoxx.hashnode.dev·May 23, 2024Understanding the Difference: undefined and not defined Errors in JavaScriptIntroduction JavaScript, being a dynamically typed language, provides flexibility and power to developers. However, it also introduces certain challenges, especially when it comes to variable declarations and usage. Two common errors that often confu...DiscussJavaScript
Shivam Katareshivamkatareblog.hashnode.dev·May 12, 2024Understanding Undefined Versus Not Defined in JavaScriptJavaScript is a great language, but it's quite different from other languages. It has many unique features that don't work the same way as in other languages. One distinctive aspect is the concept of undefined, which sets it apart from other language...Discuss·38 readsJavaScript
manish maharjanforJoBins Engineeringblog.jobins.jp·Mar 25, 2024Understanding null and undefinedNull and undefined are both are primitive data types in JavaScript. Both provides the similar feelings when observed at theoretical level. Sometime times the consequence are more debugging and clarification for the usage of these two values. Null The...Discuss·15 likes·26 readsnull vs undefined
Reddy Divyathedivyareddyy.hashnode.dev·Mar 2, 2024Undefined vs Not defined in JavaScriptGreetings, fellow coders👋 Let's get to know the difference between undefined and not defined in JavaScript. undefined In the Memory Creation Phase, the JS engine allocates a placeholder to the variable called undefined. It also represents the return...Discuss·32 readsJavaScriptnotdefined
Ojas Elawadhiojaselawadhi.hashnode.dev·Nov 21, 2023Understanding the Difference Between Null and Undefined in JavaScriptIn the realm of JavaScript, the concepts of null and undefined often lead to confusion. While they might seem similar at first glance, they serve distinct purposes in the language. Let's dive into the details of null and undefined, and understand how...Discussundefined
Jassahib Singhjassahib.hashnode.dev·Oct 18, 2023Why is there Undefined & NULL both in JavaScript and What's the difference?In JavaScript, we have NULL and Undefined which upon comparing with the equality operator returns True, because they both imply the same thing that the variable doesn't have a value. But while comparing them with the strict equality operator it retur...Discuss·1 like·32 readsJavaScript
Ritesh kushwahariteshblogs.hashnode.dev·Oct 7, 2023When we get a Error and its MeaningIn JavaScript, you can encounter situations where a variable or value is undefined, results in a ReferenceError, or produces NaN. Here's a brief explanation of each: undefined: This typically occurs when you try to access a variable or property that...Discusserror