From e95a45516d188223d523d0ddb224c0ee8d26f3ce Mon Sep 17 00:00:00 2001 From: danqzq Date: Thu, 29 Jan 2026 16:32:34 -0500 Subject: [PATCH] Fix typo in note about numeric comparison operators (common mistake no. 29) --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 8c3345c..9b0d5b2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -542,7 +542,7 @@ It’s essential to understand how to use `==` and `!=` to make comparisons effe ???+ note - We can also use the `?`, `>=`, `<`, and `>` operators with numeric types to compare values and with strings to compare their lexical order. + We can also use the `<=`, `>=`, `<`, and `>` operators with numeric types to compare values and with strings to compare their lexical order. If operands are not comparable (e.g., slices and maps), we have to use other options such as reflection. Reflection is a form of metaprogramming, and it refers to the ability of an application to introspect and modify its structure and behavior. For example, in Go, we can use `reflect.DeepEqual`. This function reports whether two elements are deeply equal by recursively traversing two values. The elements it accepts are basic types plus arrays, structs, slices, maps, pointers, interfaces, and functions. Yet, the main catch is the performance penalty.