The PS4 doesn't allow just-in-time compilation so you don't get the performance a modern javascript engine normally guarantees so on what planet is this a good idea
@wallhackio The JavaScript Planet, a dystopian world where JavaScript is the only programming language ever invented
@vaporeon_ I love JavaScript, so delete this please
@wallhackio But you don't love writing a computer game in JavaScript! (Or at least, I hope you don't love that...)
@vaporeon_ depends! https://corru.observer/ was written entirely in JavaScript and it is cool as shit
@vaporeon_ I love JavaScript, so delete this
please
@wallhackio How do I deallocate memory / destroy an object in JavaScript? So that I can delete this
?
@vaporeon_ npm install memory-management
@wallhackio Nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
And in standard JavaScript? No NPM?
@vaporeon_ it was a joke lmao
@wallhackio But can you do any memory management in JavaScript?
const deleteThis = () => {
const temp = { _this: this };
delete temp._this;
};
@aescling @vaporeon_ this will NOT do what it's being promised to do, this is a joke
@aescling @vaporeon_ this
is a joke
@wallhackio @aescling What will it do?
@vaporeon_ @aescling it will create an object with a single property named _this
that has the value of whatever this
was where the arrow function was declared
and then it will delete that property from the object
@wallhackio @aescling So creating the object initializes _this
with a copy of the value of this
, and only that copy gets deleted?
@vaporeon_ @aescling yessir
@wallhackio @vaporeon_ not a copy but a refurence
@wallhackio @vaporeon_ what gets deleted is the refurence
@aescling @wallhackio Is a reference the JavaScript version of a pointer?
@vaporeon_ @wallhackio yeah basically
javascript wonkery
@wallhackio @vaporeon_ fur the record, the following alternative implementation is subtly but meaningfully diffurent:
const deleteThis = function() {
const temp = { _this: this };
delete temp._this;
};
arrow functions and functions defined with the function
keyword have intentionally diffurent rules about resolving this
@aescling @wallhackio @monorail Ms. Glaceon, please, we need that emoji
Maybe call it blobcat_eyeroll
, for consistency
@vaporeon_ @wallhackio @monorail “Ms. Glaceon”
@vaporeon_ @wallhackio @monorail makes her sound like a very tall elementary school teacher
@aescling @wallhackio @monorail Elementary school with a Python code-golfing class
@monorail @vaporeon_ @aescling hi ms. glaceon you are so cool
@monorail @vaporeon_ @aescling how is that confusing, it is simply an objective fact
@wallhackio @vaporeon_ @aescling i just don't understand the relevance to anything
@monorail @vaporeon_ @aescling it wasn't a reference to anything, you were just there and I felt like saying something nice
anyway if you want to see how they made this terrible idea actually work then watch https://www.youtube.com/watch?v=p4upNgl1I2o