Skip to content

Commit

Permalink
use backwards index
Browse files Browse the repository at this point in the history
  • Loading branch information
neroist committed Jul 3, 2024
1 parent e55293a commit 1350dc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/call_nim_from_js.nim
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ proc main =
echo "function_raw_binary 1 (", len1, " bytes): ", raw1

# check raw2 (Big)
if raw2[0] == chr(0xa1) and raw2[len2 - 1] == chr(0xa2):
if raw2[0] == chr(0xa1) and raw2[^1] == chr(0xa2):
echo "function_raw_binary 2 (", len2, " bytes): valid data? ", "Yes"
else:
echo "function_raw_binary 2 (", len2, " bytes): valid data? ", "No"
Expand Down

0 comments on commit 1350dc0

Please sign in to comment.