javascript arrays finance investing psychology