Slice-3

 

Example of slice with negative values

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <script> var str = "Apples are round, and apples are juicy."; var sliced = str.slice(-3, -2); document.write( sliced ); </script> </body> </html>
Output