String Methods

First thing to mention should probably be that API stands for Application Programming Interface. It's code that lets two applications communicate with each other, taking the inputs from a user and delivering them to the system then returning the reply.
I'll be going a little more in-depth with JavaScript specifically and its variety of methods that deal with strings.

The first one we'll look at is string length. It returns the length of the specified string. Simple enough.

                        
                            let msg = "seven";
                            let length = msg.length;
                        
                    
Returning the length variable would give a result of 7, useful for things like password fields that check for numbers of characters.

Next is replace() and it does what it says. It replaces the the first instance of a specified string with another you provide.

                        
                            let msg = "This page contains HTML, CSS, and HTML."
                            let newMsg = msg.replace("HTML", "JavaScript");
                        
                    
The message would thus become "This page contains JavaScript, CSS, and HTML."

Lastly, I'll mention includes(). It searches for strings that include the string it's given

                        
                            const msg = "This string contains words."

                            let result = msg.includes("words");
                            console.log(result);
                        
                    
The console would display 'true' as the message does contain 'words'.