js

Seismic Change / We Mean This

Submitted by daniel on Tue, 30/11/2021 - 13:21
  • Implemented custom ticker tape type jQuery plugin to be used on Seismic Change Home Page for enabling dynamic text.
  • Assisted with other changes including re-implementing Squarespace video hero with support for custom configuration including enabling the do not track feature on initial load.
  • Helped to implement EU cookie and GDPR compliance.

Seismic Change / We Mean This

Date Created

Stock Price Tracking

Submitted by daniel on Fri, 04/12/2020 - 03:02

Say we have an array of values that represents the stock price of duckduckgo over time.

e.g.

const stocks = [1, 0, 5, 14,  -1, 10];

How do we write a function that tells us what the biggest margin is? What is the optimal price that we can both buy and sell at? We cannot sell stock before we buy it. 

One approach requires iterating though each number and calculate the delta of every price in the future to ensure that we only make comparisons going forward in time. 

Here is an example

Tags: