Object modification, and my lack of JS knowledge...



  • I have an object as look up table.
    Via a button, I load this object in a panel.
    Then when I modify the value in panel.data, it is the original object that is affected. Well, it's normal behaviour since I pass the object to the panel...

    So how can I set the value in the panel and keep the original object untouched?

    I know I can populate the panel.data from the object's values in a for loop instead of passing it directly, but is it the best way?

    HiseSnippet 973.3ocsV80aaaCDmxIbsVctnEXOWHjmjA5Lj2Z6FPvPcscxfQWRMl6JFPPVAMEcLanHMjn5lQQdbeu12i89ddeC1NRJYIu33lZfI+fw8meG+cGOdjiSUTVVlJE4070KWvPdeNdxRod9f4DtDMZHx693SHYZVZfSU+kKHYYrXjm2deuQgWy8Q1u+948IBhjxpTgPuQworefmv0UZG26kbg3XRL607jZd+jdinJ4.kPkC7YObDZAgdI4B1oDiaMvHuO6nXtVkNQSzrLj298UwKmLW8qRm+ugmwmJXFgtnIPfbpOVIhML1nEMXNWDOtLuyPPTFWUE1yUE9B7I7X9J8UUiGXMDTgnd8vqw1nW2ON8h1D87pQu8cz6g3IzT9BckEC2tGdjD1nlQfsf5zx4Kpwe0.OPAdH0cRHWxNNEDVgH7YQQON3oQQsOrkO3VlRv5PELRZnQi6Gr8joCdOIMXLQxDcC9tfxHdASOPkrPIAgvCblOvgrBkZ56XTMf5LXshNeUba4ykBtjELKWR0bkLPIEJR7HoMP80RyxjpDgzx03wP.E4r1s7+PK+l7YAgNYiT.7U7miHchIZRG8bt7BXwcr3P+lW0x+JW1tgTX80+f1cxLlsrX.QHlBslg2.Kau0D6kR0ztaOeLL2jR7rgrY.73vqkGsaW321R1yhNGxWafOz48VSYKytoLsNsMIXsL5Tkl8JYXa+O32z+J+f+qoYy1nshfIXoazrY3P51.FJySlxRKqbkNBmRV+X38tcGCotZRMGUxQRt9UKXEx0miTl0kViPqR15ppxw5Zso1FbqR00mCfJ1yfIBMJbGbUamGb+h4ASD7XVJhCb7NX6FFxVaJlw9GO52+ymitIv8y0ZkzB9A306qWKJtueZzPnMyLdpfW.WWvR0bSE2aH68vbe2vpl3grrK0pEvJtpYC1j9nT+2Vsf8Nq2xpU+W5gtdbZUNRzPYaXtK1cdnVbfukqkE0hC91WMpEvyqQrdi6wyNQk.gijBp8Zft9na3BDUbtfnW+VEyUoEFfd70FeaFQKy35k0up8S3plna8Mg2V59P7XtlNey7swF3qom8+Y9VbwcK7QylAS2qH693i+4c8V5OAp7ipbMLw8DhNkC8G3SySl.uigx.lHg9FXgvPCgApUNxHapLSXxXqv+.eEF6Zj8JL1szHJgPSUuk5N+ZdZvcsZ.NIsuPpI7TMPNX0odLNpSDJAdwxaoTSo3KAtuYLe0Nf4q2ALOYGv7zc.yy1ALeyNf4a2JFyiEeQtVk3Nl.JFejctom2QRBzkY6HQ+KmUWHwB
    


  • https://forum.hise.audio/topic/2198/get-array-by-value

    const var foo = {"animal":"cat", "food":"pie", "colour":"blue"};
    
    const var bar = foo.clone();
    
    foo.animal = "dog";
    
    Console.print(bar.animal);
    


  • @d-healey Yes!!! I remember now, you did it few days ago! Thanks David! 😃


Log in to reply
 

10
Online

882
Users

3.2k
Topics

26.7k
Posts