string.slice(beginning, finish)
There are some cases where the structure only is composed of one argument that only indicates the position where we will make the extraction. This is an example:
var url = "https://www.yahoo.es"; document.write(url.slice(7));
In this example, the code will extract the characters that are from the indicated position.
In the following case the code will extract the characters from a position to other, looking for example this code block:
var frase = "La sociedad es el motor del futuro"; document.write(frase.slice(4,10));
In this example, the code will write the characters from an associated position with number 4 to the 10th (it has assigned the number nine but like it's a final argument we will add 1 being indicated 10, the real position), being the written message "ociedad".