<p>See code: </p>

<pre><code>var file1 = "50.xsl";
var file2 = "30.doc";
getFileExtension(file1); //returns xsl
getFileExtension(file2); //returns doc

function getFileExtension(filename) {
    /*TODO*/
}
</code></pre>

```
```
return filename.replace(/\.([a-zA-Z0-9]+)$/, "$1");
```
```
edit: Strangely (or maybe it's not) the
```
$1
```
in the second argument of the replace method doesn't seem to work... Sorry.