Problem with relationship between variables

Problem with relationship between variables

Hi guys,

I'm pretty sure this question has been asked before but I couldnt find anything even though I tried alot of different descriptions for my problem. So this is what I do. I have a js-File that basically looks like this

  1. abc = function(){
  2.       var initialStartTime = new Date();
  3.       
          return{
                init: function(){
                currentAgenda  = ...//something from localStorage

                initialStartTime = new Date(currentAgenda[0].startTime)
                }, updateAgenda: function(){
                      currentStartTime = initialStartTime;
                     currentStartTime = new Date(some new Date);
                      

                }
          }
I want my initialStartTime to be set one time in the init-Function. However if I change the currentStartTime it always also changes my initialStartTime

Any ideas how i can prevent that from happening? Thanks alot in advance

Greetings Chris