Skip to content

Commit 881d629

Browse files
fix: code block
1 parent 00cac2d commit 881d629

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

data/blog/software-development/web-development/frontend/javascript/slice-vs-substring-vs-substr-complete-javascript-string-methods-comparison.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ console.log("\n=== Example 6: Positive start, negative end (4, -3) ===");
788788
console.log("slice(4, -3):", str.slice(4, -3)); // "Scr" (from index 4 to -3, which is position 7)
789789
console.log("substring(4, -3):", str.substring(4, -3)); // "Java" (negative treated as 0, swaps to substring(0, 4))
790790
console.log("substr(4, -3):", str.substr(4, -3)); // "" (negative length treated as 0)
791+
```
791792

792793
## Real-World Use Cases
793794

0 commit comments

Comments
 (0)