Length of a JavaScript object
1:27
Пікірлер
@mohammadsamim9794
@mohammadsamim9794 4 сағат бұрын
Sir there is any possible way to set input type file ,then please reply
@user-ws4ue5rf8c
@user-ws4ue5rf8c 4 күн бұрын
❤😮
@duckboy81
@duckboy81 24 күн бұрын
Awful code. Hard to read and easy to mess up
@Brunoenribeiro
@Brunoenribeiro 25 күн бұрын
Interesting, but please, never add this to a professional codebase. You will only make your colleages' life a bit more miserable when they lose time trying to understand this obscure exploit of the language.
@Kampouse
@Kampouse 25 күн бұрын
(() => console.log("hi"))()
@dunkyl
@dunkyl 26 күн бұрын
Syntactically, it prevents the function from being a statement instead of an expression. As compared to using parentheses, it is just one character shorter.
@ethos8863
@ethos8863 26 күн бұрын
this is typescript
@Ciph3rzer0
@Ciph3rzer0 27 күн бұрын
Downvote for ai voice. You didnt even put in any work to make it understandable.
@deltashit
@deltashit 26 күн бұрын
Yeah, this is just one of the ever increasing amount of bs AI videos
@user-tx3pv1xl6g
@user-tx3pv1xl6g 27 күн бұрын
never thought comparing an object to number would convert both to string 💀
@karola.7908
@karola.7908 26 күн бұрын
It does make a lot or sense, you're converting to the lowest common denominator, and since everything can be a string, the lowest denominator is a string
@tolleythinking1058
@tolleythinking1058 28 күн бұрын
I will add this to my folder of cursed javascript code snippets I bring up on a regular basis.
@scottwalker4619
@scottwalker4619 27 күн бұрын
This isn’t necessarily an issue with JavaScript. You could do this in any language. You’re just manipulating the return value increment at every call
@tanyuanzheng797
@tanyuanzheng797 27 күн бұрын
@@scottwalker4619 No sane language would or should use the equality so operator so loosely as to use tostring to check for equality, so this is absolutely a Javascript issue lol
@scottwalker4619
@scottwalker4619 27 күн бұрын
@@tanyuanzheng797 In this specific way he did it, he made use of the loose equivalent JavaScript. But this would also work with a property in C# with equivalent logic on the getter directly on an int, float or string. E.G. int I = 0; Int x { get { return I++: } } This would also work (I’ve left out the class and encapsulation for simplicity) In C++ you could overload the operators (and in C# thinking about it).
@vil-mo
@vil-mo 26 күн бұрын
​@@scottwalker4619C# and C++ aren't sane. Why getter can mutate state... In what real world scenario it wiĺl be useful... Rust is the best
@scottwalker4619
@scottwalker4619 26 күн бұрын
@@vil-mo It wouldn’t be useful, but that’s not the point of the video. Nobody in their right mind would do that but it doesn’t mean that it’s not possible. No language is the best. They all have good use cases for when and when not to use them. Normally the “best” language to use is the one that you know.
@viditsharma1632
@viditsharma1632 Ай бұрын
1st viewer
@rat2244
@rat2244 27 күн бұрын
hopefully the last one too
@calvinlucian387
@calvinlucian387 Ай бұрын
If AI has learnt how to generate Regex then we're surely out of jobs for humans.
@andyluckner4757
@andyluckner4757 Ай бұрын
hello please I have script auto book. I want to update it please can you help me ?
@JechtNH
@JechtNH Ай бұрын
It will never stop blowing my mind, that there barely anything so purely logical like programming and yet we have JavaScript with all the nonsense
@codesamples1596
@codesamples1596 Ай бұрын
when I write code in regular java it seems to me that javasciript is a saint
@JechtNH
@JechtNH Ай бұрын
@@codesamples1596 oh really? It’s the other way around for me, perhaps I’m biased as Java is my primary language :)
@user-pk1nu5tn6q
@user-pk1nu5tn6q Ай бұрын
it's like different ways of thinking
@cade6488
@cade6488 Ай бұрын
Thanks!
@codesamples1596
@codesamples1596 Ай бұрын
Welcome!
@user-zw8rz3vy7j
@user-zw8rz3vy7j Ай бұрын
thanks!
@codesamples1596
@codesamples1596 Ай бұрын
Welcome!
@hr02vloggers31
@hr02vloggers31 Ай бұрын
Did I applied it in my php code
@codesamples1596
@codesamples1596 Ай бұрын
Yes <?php echo "<script>**JS CODE**</script>" and go on
@ammonjerro396
@ammonjerro396 Ай бұрын
not works
@honwei3104
@honwei3104 2 ай бұрын
Thank You
@codesamples1596
@codesamples1596 Ай бұрын
Welcome!
@Carramoz
@Carramoz 3 ай бұрын
This is good to know, bruh!
@rajamd2009
@rajamd2009 5 ай бұрын
Hi Please make one video, How to set (Windows/Mac) system date format in datetimepicker using Javascript?
@dominicezirike6810
@dominicezirike6810 6 ай бұрын
how about retrieving multiple items from the list
@Light13378
@Light13378 6 ай бұрын
Did you solve the problem if yes can you make a video for it i have problem like your
@sruthielankumaran1752
@sruthielankumaran1752 6 ай бұрын
How to convert current time to utc
@silent_emotions
@silent_emotions 6 ай бұрын
Huh?
@vrynstudios
@vrynstudios 6 ай бұрын
How do you make it like automatically typing?
@ellrosca8380
@ellrosca8380 9 ай бұрын
You can use: "/ /g" 👍
@cryptogenik
@cryptogenik 9 ай бұрын
NOO THIS IS WRONG!!!
@juanalonsopajuelochipana1922
@juanalonsopajuelochipana1922 9 ай бұрын
estoy en la misma, no entiendo que puedo hacer con jsx que no pueda con js
@ban-prem-001
@ban-prem-001 10 ай бұрын
you could basically import within a module, it does the same thing
@vnfy2038
@vnfy2038 10 ай бұрын
sc ?
@Benneth12
@Benneth12 10 ай бұрын
* C O O K I E *
@onlinecodingstudent
@onlinecodingstudent 10 ай бұрын
Nice
@sandpaperunderthetable6708
@sandpaperunderthetable6708 10 ай бұрын
"".join(string.split(" ")[:-1])
@woongda
@woongda Жыл бұрын
why are you using 32 int and bitwise not? actually why you bother to write contains(), what is wrong with using includes() ?
@pauljohnlabastida6342
@pauljohnlabastida6342 Жыл бұрын
just add class name to all text boxes and radio buttons inside the form, then do the inside your function instead. $('.in_textboxes').val(''); $('.in_radiobtn').prop('checked', false);
@keinnerross.6223
@keinnerross.6223 Жыл бұрын
Cool! New subscriber
@codesamples1596
@codesamples1596 Жыл бұрын
GPT explane: This code creates an array of numbers [2, 5, 9] and logs it to the console using console.log(). The code then uses the indexOf() method to find the index of the number 5 in the array. The indexOf() method returns the index of the first occurrence of the specified value in the array, or -1 if it is not found. Next, the code checks if the index of 5 is greater than -1. If it is, that means the item is found in the array, and the code uses the splice() method to remove the item at the specified index. The splice() method can be used to add or remove items from an array. In this case, the second parameter 1 specifies that only one item should be removed. Finally, the code logs the updated array to the console using console.log(). The updated array [2, 9] no longer contains the number 5. It's important to note that the splice() method modifies the original array, so the original array [2, 5, 9] has been changed to [2, 9].
@codesamples1596
@codesamples1596 Жыл бұрын
This code defines two functions removeItemOnce() and removeItemAll() that remove a specified item from an array. The removeItemOnce() function takes an array arr and a value value as input. It first uses the indexOf() method to find the index of the first occurrence of value in the array. If the value is found (i.e., the index is greater than -1), the splice() method is used to remove the item from the array. Finally, the function returns the updated array. The removeItemAll() function takes the same input as removeItemOnce(), but instead of removing only the first occurrence of the value, it removes all occurrences of the value from the array. It uses a while loop to iterate over each item in the array. If the current item is equal to value, it is removed using the splice() method. If the item is not equal to value, the loop increments the index to move to the next item. Finally, the function returns the updated array. To test the functions, console.log() is used to output the updated arrays after calling each function with an array [2,5,9,1,5,8,5] and a value 5. The first console.log() call uses the removeItemOnce() function and outputs [2, 9, 1, 5, 8, 5]. The function only removes the first occurrence of 5, so the array still contains two more occurrences of 5. The second console.log() call uses the removeItemAll() function and outputs [2, 9, 1, 8]. The function removes all occurrences of 5 from the array, so the updated array no longer contains any 5.