TinyChan

New reply in topic: Random discussions thread

You are not recognized as the original poster of this topic.

:

You are required to fill in a captcha for your first 5 posts. Sorry, but this is required to stop people from posting while drunk. Please be responsible and don't drink and post!
If you receive this often, consider not clearing your cookies.

Please familiarise yourself with the rules and markup syntax before posting.


Replying to Anonymous Z-9…

@657,182
Notice that there are also some instances of collisions, for example the symbol × (158, 0215, “multiplication sign”) has replaced (158, “Peseta Sign”) on modern Windows, but this object would return for Alt+158.
To avoid reassigning existing keys and their values, you could do this:
if(altCode in object){
	if(typeof object[altCode]==="string"){
		object[altCode]=[object[altCode],unicode];
	}else{ //is an array…
		object[altCode].push(unicode);
	}
}else{
	object[altCode]=unicode;
}