var year = '2004-11-01';
console.log(year.split('-')[0]);
console.log(year.substring(0,4))
FAQ: FAQ
Source code: GitHub/MeasureThat.net
Report issues: MeasureThat.net/Issues
Based on: Benchmark.js
Facebook page: https://www.facebook.com/MeasureThat.Net
Python benchmarks support: Pyodide