Using length vs not using length
Hi,
Is there any difference between:
- var nameValue = $('#edit-name').val();
- if (nameValue) {
- $('#edit-name, #edit-pass').addClass('withValue');
- }
And this:
- var nameValue = $('#edit-name').val();
- if (nameValue.length) {
- $('#edit-name, #edit-pass').addClass('withValue');
- }
Thanks